A motor or servo (if you choose to use a motor, you will need the L293D Motor driver) Picaxe 28X1 board and chip (this can be done with other microcontrollers, but I am using this one) A computer (Mac or PC, doesn't matter since the code will be on the board itself) AXEPad (Programming software for Picaxe, can be found for Mac OSX, Windows, and Linux)
NOTE: you will need a soldering iron and solder for this.Once you have your servo or motor connected, plug in the battery case, put three double A's into it, then plug the USB cable into the board and the computer. After that open up AXEPad. You are now ready to program it.
#Picaxe 28X1 #Terminal 4800 Do SerRxd b0 SerTxd( "You typed ", b0, CR, LF ) if b0 = "o" then 'the o can be changed to whatever letter you want (in this case o≠O, so you have twice as many options) servo 0,75 'this should be replaced by the motor command if you use a motor instead, It is high 4, low 5, or high 5, low 4 for one of them, or high 6, low 7, or high 7, low 6 for the other. wait 2 'this command is specifically for the servo, otherwise it will not turn all the way end if if b0="i" then 'again, this can be changed to suit your preferences and i≠I servo 0,225 'If you use a motor, switch the high and low values wait 2 'again, you don't need this if you are using a motor end if if b0 = "p" then servo 0, 150 'this centers the servo, put all values on low to stop the motor wait 2 end if Loop
Press f4, or go to PICAXE>check syntax to make sure everything is entered correctly, then press f5, or go to PICAXE>program to download the program to the board