Let's Make Robots!

EEPROM code for iCon...

This is a simple code that takes values from a pot and adc channel, writes it to the eeprom, then plays back these positions to a servo. This is a very basic version of what I use to prerecord moves for walter's head.

 

i2cslave %10100000, i2cslow, i2cbyte

main:
for b1=0 to 255 step 1
readadc 1,b2
gosub writeit
gosub servomove
next b1
goto playback


writeit:
writei2c b1,(b2)
return

playback:
pause 3000
for b1=0 to 255 step 1
readi2c b1,(b2)
gosub servomove
next b1

servomove:
servo 0,b2
pause 50
return
 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Thanks, i have some experimenting ahead of me.