Let's Make Robots!

Mr. General Picaxe programming

Last weekend my Mr. General set arrived, and I put it together. It's working, for the most part...I've written out some simple programs for my 28x1 picaxe and tested all the individual parts.  I can turn all the servos, read the light meter readings from the eye in debug mode, and make the LEDs flash.  But the included code to run it all together doesn't seem to work (the robot just sort of twitches) and I am looking for some inspiration from other bits of code to try out.  So if anyone has Mr. General code to share, I'd be interested.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

You say the code doesn't work? I am guessing your inputs and outputs may not be connected to the right pins. Two different things can make the robot just sit there and twitch.

1. A bad connection to the IR eye, usually power or the signal pin to turn on the IR LEDs. This causes all analog inputs to be the same value effectively blinding the robot.

2. if your picaxe chip is breadboarded then the resonator is not getting a good connection.


The resonator is probably the source of the problem, since I don't have one.  I didn't have on on hand, and I saw the chip had an internal one, so I thought I'd give it a shot without.  I suppose I should go track one down.

You can use the internal resonator if you adjust the sample code accordingly but you would have to run at 4MHz for the servos to function correctly and the robot would be very slow to respond. You would also have to modify the tracking code to compesate for the slowness otherwise the servos will overshoot when tracking.

To begin with I suggest using the picaxe 28X1 with a 16MHz resonator or a 16MHz crystal and 2x 22pF capacitors. Once you have the sample software working as intended then you can experiment with modifying the code or using a different processor. A 20X2 would be a good choice.

I guess I'll have to track down a resonator somewhere then.