Shop OBEX P1 Docs P2 Docs Learn Events
trying to control a servo with a pot through boe+eb500 — Parallax Forums

trying to control a servo with a pot through boe+eb500

LLordLLord Posts: 9
edited 2004-10-07 18:58 in Robotics
Hi all

First of all I am new to the stamp. so dont expect me to know squat.
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

  • LLordLLord Posts: 9
    edited 2004-10-05 18:48
    code snippets that I am fussing with.

    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 ?
  • Jonny555Jonny555 Posts: 46
    edited 2004-10-05 18:52
    A quick web search revealed an instruction manual for the eb500. Do you have this manual... after setting up the eb500 you can send data via serout.
  • LLordLLord Posts: 9
    edited 2004-10-06 01:56
    After about three more hours of messing about I finaly hooked up a hard wire connect between my two BOE's and found that I am getting the same garbled data that was coming through the eb500.

    is there any thing special about the BS2sx ? and the serin and serout commands. ot the sx chip in general?
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-10-06 14:38
    Yes, the BS2sx uses different constants for the baud-rate selection.
    Check the manual -- sorry I can't be more helpful than that.
  • LLordLLord Posts: 9
    edited 2004-10-07 18:08
    ok new part of the question
    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?
  • LLordLLord Posts: 9
    edited 2004-10-07 18:58
    ok here is the code I finaly came up with.
    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
Sign In or Register to comment.