servo control
I am considering getting into the Sx. I am familiar with the BS2.
Can anyone tell me how easy it would be to control simple I/O relationships? For insatnce I would like to control a servo from a sensor.
If this is fairly easy to get at, it would seem on a very basic level to be a very cost effective solution over the BS2.
thank you
Can anyone tell me how easy it would be to control simple I/O relationships? For insatnce I would like to control a servo from a sensor.
If this is fairly easy to get at, it would seem on a very basic level to be a very cost effective solution over the BS2.
thank you

Comments
Code for the BS2 to pan a servo back-n-forth
' {$STAMP BS2p} ' {$PBASIC 2.5} ServoPin CON 0 ServoMin CON 1250 'equals 1mS at 0.8uS resolution ServoMax CON 2500 'equals 2mS at 0.8uS resolution ServoTemp VAR W1 LOW ServoPin OUTPUT ServoPin MainLoop: FOR ServoTemp = ServoMin TO ServoMax STEP 10 PULSOUT ServoPin,ServoTemp PAUSE 20 NEXT FOR ServoTemp = ServoMax TO ServoMin STEP 10 PULSOUT ServoPin,ServoTemp PAUSE 20 NEXT GOTO MainLoopCode for the SX to pan a servo back-n-forth
DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX FREQ 4_000_000 ServoPin VAR RB.0 ServoMin CON 100 'equals 1mS at 10uS resolution ServoMax CON 200 'equals 2mS at 10uS resolution ServoTemp VAR Byte LOW ServoPin OUTPUT ServoPin MainLoop: FOR ServoTemp = ServoMin TO ServoMax STEP 1 PULSOUT ServoPin,ServoTemp PAUSE 20 NEXT FOR ServoTemp = ServoMax TO ServoMin STEP 1 PULSOUT ServoPin,ServoTemp PAUSE 20 NEXT GOTO MainLoop▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.