No news is … too busy to write anything.

I’ve been busy with buying a car and sorting out a summer holiday to write anything recently but I did manage to find some time to mount my arduino and breadboard onto a piece of perspex last week.  It looks pretty neat and it means that I can wire circuits without everything falling apart.  I plan to stick some wheels and motors (from the printer) on it soon.  I don’t know what kind of battery I’ll need for those motors since they are rated for 18V.  9V (and less) does work but I guess that they’ll drain the batteries pretty quick.

Finding some wheels that will connecting to the motors is going to be fun but I’ll come up with something.

Before then, I’ll use the breadboard and arduino to do some IR tests.  I want to be able to read the codes coming from my iSobot remote control so that I can then use the arduino to program the iSobot more easily.  I know how to do all this, it is just finding the time to do it.

Over the last week, in a bid to get something starting on my tutorials for this blog, I finally settled on a version of GNU/Linux to recommend to new enthusiasts.  I’d recommend, Xubuntu .  I have an old laptop computer (Dell Inspiron 1150) that has 512Mb RAM and 2 Ghz Pentium II.  It is about 5 years old.  I installed a few different distros on it and now it is beginning to creak with the features. Ubuntu has always been easy to install, but it is a ‘friendly’ desktop.  Xubuntu is a very lightweight and fast version of this distro which is why I chose it.

The first additional packages for me to install were b43-fwcutter (because my wireless card doesn’t work otherwise), java runtime (sun-java6-jre) and then installed eric & IDLE (for Python) but maybe Eclipse would be a better alternative.  I ought to grab python-pygame (SDL bindings for Python) also as this is going to be useful for learning to program.  Lastly I grabbed the latest version of Arduino IDE , avr-gcc & avr-libc.

From this I should be able to provide enough information for the Programming of Robots and Video Games.  I said ages ago that I wanted to create my own Distro and this could be the first steps for a Beginner’s Programming Distro.

You’ve probably notice I’ve settled on Python for programming.  This isn’t because it is the best language for programming video games but it is a good interpreted & compiled language which reminds me of my BBC BASIC programming days.  It has idosyncracies that I don’t like but I fancy writing about programming before writing about C++.

Advertisements

Christmas, New Year and the i-Sobot

I’ve had a throat infection over Christmas.  I didn’t do as much robotting or programming as I’d hoped I would.

My mother-in-law bought me 123 robotics projects for the evil genius for Christmas and it is a good book of general hints and tips.  It sadly doesn’t have any “follow these step by step instructions” to make a giant robot but each individual project will lead you to better knowledge.  It also has some really good introductions to programming with PIC Basic.

I managed to fiddle with my Arduino so more and wire up a wheely robot with an IR proximity detector.  Unfortunately I didn’t complete it.  The final wiring between the Arduino and the hardware kept coming apart and I managed to set my arduino IDE up to program the wrong hardware and that took me about an hour to spot.  I need to get back to it soon.

Because of this little set back I browsed the web and spotted Amazon selling the i-Sobot for half price (£100).  So I bought one a few days ago and it arrived yesterday.  It is really good for it’s size and does a lot of things that have kept me amused for a couple of hours.  It isn’t possible to hack it easily but I think I’ll try to wire up an IR transmitter to the same frequency as the i-Sobot so I can send it commands from a PC or from a programmable remote.  Programming the i-Sobot remote is a bit fiddly and it is easy to loose what you’ve programmed.

robot game c++

I looked at the stats for my blog today.  It turns out that the only search that has found this site was one for “robot game c++”.  It intrigued me and I discovered that I’m second from top in Google for that search.  I wonder what the person who used this term was looking for.

If you have any thoughts about what I should program regarding “Robot Game C++” then leave a comment.  I’ll do my best to fullfil your need!

My Drum Robot

One of the most interesting robots around is the Yellow Drum Machine.  I couldn’t come up with anything better so I thought I’d have a got at recreating one (but not as cute!)

I have;

  • 2 wheel motors
  • a base from the ESCAPE robot
  • 2 other DC motors for drum sticks
  • a microphone
  • 3 x IR transmitters and 1 IR receiver
  • arduino/atmel microprocessor

The idea is to use the IRs to detect surroundings and know there is something to drum on.  The microphone wouldn’t record the drum sound and play it back like Y.D.M.  I wanted the microphone so it would have some kind of ears.  If possible it would be nice to have it mimic beats that it hears while it isn’t playing.

Again, use Arduino as the microprocessor core.

Talking Head

An obvious project for robot building is the talking head.  I can see a very small commercial market for this should I be able to make it.

Basically I require a head that can open and close its mouth and tilt its head around to ‘apparently’ be looking.  Anything else is a bonus; such as eyes the move/blink and an arm or other appendage.

The main part is to have an MP3 player that can be programmed to play speech as necessary and then have the mouth and head move in time to the noises coming out of the MP3 player.

My plan is to have:

  • Arduino/Atmel microprocessor
  • USB drive/SD card for MP3 and motor control data (in sync with each other)
  • 3+ servos (for mouth and head movement, etc.)
  • Speaker & simple amplifier for audio
  • MP3 circuit (VMUSIC2 or MOD-MP3)
  • Remote control – to start and stop the conversation

I’ve got all (SD & MOD-MP3) except for the head and the servo motors.

Why program?

I’ve been away for the weekend (mother-in-law’s) and thought about why anyone should want to program: whether it be for a console game or on a robot.   It is going to be different for different people but most commonly it is because you like to see (or hear) stuff happening based on a pure set of instructions you give to a bit of hardware.  I think it is a bit like cooking.  You build a recipe which, when followed, will create a great meal.  Like cooking though, outside influences or mistakes in following the recipe will give some very odd results.  With experience, more of the programs you write will start to work first time.  At whatever level, you’ll be glad of a good debugger so also learn how to debug well.

I’ve started writing about what it takes to get a program in C++ but that is a really bad place to start.  C++ is hard if you’ve never programmed before. If you’ve never ever programmed then you should look at Python or Java to get you started, and don’t try to write a game first.  In order, I’d suggest the following:

  1. Program to solve something.  Use the computer like a programmable calculator.
  2. Program to control something.  A robot is my suggestion if you can build it, otherwise the usual school example is to control traffic lights.
  3. Program to simulate something.  A bouncing ball or firing a cannonball on a 2D screen.
  4. Program several aspects. Bounce a ball that can hit a target and provide a score.  Although this is small, there is a right way and a wrong way to do this.  Keep the different aspects of the code separate so that they can be replaced with other systems.

After these, you’re on you way to understanding how a computer programmer works.  You’ll also know what I mean when I say, “open your IDE or favourite editor.”  There are plenty of tutorials on the web to get you started.  I’ll get around to linking to some here.

%d bloggers like this: