trying to control a servo with a pot through boe+eb500
Hi all
First of all I am new to the stamp. so dont expect me to know squat.
![blush.gif](http://forums.parallax.com/images/smilies/blush.gif)
What I am trying to do is this,· I am trying to figure out how to with BS2sx , boe, and eb500, hobbie servo, the other end hooked up to a computer for programming.
I·would like to turn my pot and move the servo on the other end.
Can any one point me in the right direction ?
·
First of all I am new to the stamp. so dont expect me to know squat.
![blush.gif](http://forums.parallax.com/images/smilies/blush.gif)
What I am trying to do is this,· I am trying to figure out how to with BS2sx , boe, and eb500, hobbie servo, the other end hooked up to a computer for programming.
I·would like to turn my pot and move the servo on the other end.
Can any one point me in the right direction ?
·
Comments
servo position code
Pos VAR WORD
HIGH 12
PAUSE 1
RCTIME 12,1,Pos
DEBUG ?Pos
this returns me a position or a result of where the Pot is.
How would i get this to work with pulsout that gives me something i can transmit across the eb500 ?
is there any thing special about the BS2sx ? and the serin and serout commands. ot the sx chip in general?
Check the manual -- sorry I can't be more helpful than that.
once I have transmitted my data accross the eb500 and have it stored in a varable how do I then send that data to a pin on the stamp?
please look through and make sugestions comments or improvments please .
send code
' {$STAMP BS2sx}
' {$PBASIC 2.5}
ncount VAR Byte
pos VAR Word
INPUT 5
PAUSE 1000
SEROUT 1,240,[noparse][[/noparse]"con 00:0c:84:00:11:68",CR]
SERIN 0,240,[noparse][[/noparse]WAIT("ACK",CR)]
waitforconnection:
IF IN5 = 0 THEN waitforconnection
'DEBUG "connected",CR
FOR ncount = 1 TO 1000
HIGH 7
PAUSE 1
RCTIME 7,1,pos
' DEBUG ? pos
SEROUT 1,240,[noparse][[/noparse]DEC pos,CR]
PAUSE 25
NEXT
PAUSE 1000
OUTPUT 6
LOW 6
SEROUT 1,240,[noparse][[/noparse]"dis",CR]
SERIN 0,240,[noparse][[/noparse]WAIT(CR,">")]
'DEBUG "disconnected",CR
recive code
'{$STAMP BS2sx}
pos VAR Word
'Wait for the eb500 radio to be ready
PAUSE 1000
Main:
SERIN 0,240,[noparse][[/noparse]DEC pos]
' DEBUG DEC pos,CR
PULSOUT 12, pos/5
GOTO Main