PalmOS Cybot

Published: Mon 22 December 2003 by Ludo In Hardware
tags: atmel avr

Control a Cybot from your PalmOS based device and SmallBASIC using the servo controller below

Palm Cybot

What you need

**Warning !** Using any non free programming language could be fatal for
your Cybot (lockups, viruses, transistors blowing ...).
For cool open source on PalmOS visit palmopensource.com ;-)

Programming the Cybot

Below, you can take a look at a SmallBasic program which shows you the basics to move your Cybot with the Palm.

0Px xx commands are described in the servo controller's documentation.

As the AVR controller is able to generate PWM signals, you can control the motors speed with a 8 bits precision. In my setup, outputs 0 to 3 of the AVR based controller are wired to pins 0 to 3 of motor board. So with a:

  • 0P0 xx command you set the forward speed (to xx in hexadecimal) of the right motor,
  • 0P1 xx command you set the backward speed of the right motor,
  • 0P2 xx command you set the forward speed of the left motor,
  • 0P3 xx command you set the backward speed of the left motor.

Warning !!! As always do not turn on forward AND backward pins (i.e. '0P0 xx' and '0P1 xx' with xx>=01), or you will burn the motor controller board !

' pwm.bas
' open the serial port at 9600 bauds
OPEN  "COM1:9600" AS #1
' reset all outputs
print #1, "0P0 00\n"
print #1, "0P1 00\n"
print #1, "0P2 00\n"
print #1, "0P3 00\n"
delay 3000
10 print #1, "0P0 00\n"
print #1, "0P1 00\n"
print #1, "0P2 00\n"
print #1, "0P3 00\n"
' move forward slowly during 1 sec
print #1, "0P0 30\n"
print #1, "0P2 30\n"
delay 1000
' move forward at full speed during 2 sec
print #1, "0P0 ff\n"
print #1, "0P2 ff\n"
delay 2000
'  move forward slowly during 1 sec
print #1, "0P0 30\n"
print #1, "0P2 30\n"
delay 1000
' make a U Turn
print #1, "0P0 47\n"
print #1, "0P2 00\n"
print #1, "0P3 47\n"
delay 400
goto 10
close #1

Of course, you can use the 5 General Purpose Inputs/Outputs of the AVR controller to implement object avoidance, the sky is the limit!

LD. --

Similar posts for you:

Speak your mind: