Shop OBEX P1 Docs P2 Docs Learn Events
EasyBT bluetooth connection with bluetooth adapter — Parallax Forums

EasyBT bluetooth connection with bluetooth adapter

erdeneruserdenerus Posts: 6
edited 2009-11-06 20:33 in BASIC Stamp
hi.I have a difficulty in making connection between EasyBT and my bluetooth adapter.Athough i indicate my bluetooth's number ,when i try to send a parameter from my java program to microcontroller(indicating proper com portnumber) ,nothing happens on robot side.Meanwhile i was able to do that with cable connection.i prensent the bs code below.
Thanks for help by now

' {$STAMP BS2}
' {$PBASIC 2.5}


i VAR Word
pos VAR Byte
pulse1 VAR Word
pulse2 VAR Word
INPUT 5
PAUSE 1000



SEROUT 1,84,[noparse][[/noparse]"con BB:4A:BB:33:BD:0D",CR] //My bluetooth adapter's connection number
SERIN 0,84,[noparse][[/noparse]WAIT("ACK",CR)]
WaitForConnection:
IF IN5=0 THEN WaitForConnection
DO

SERIN 0,84,[noparse][[/noparse]WAIT(255),pos]

pulse1=pos+650
pulse2=850-pos

FOR i=0 TO 800
PULSOUT 12,pulse1
PULSOUT 13,pulse2
PAUSE 20
NEXT
LOOP

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-10-30 21:46
    Take it one step at a time. take out the code to move the bot and put in some debugs to make sure the two are communicating> are you sure there is anything being sent?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • JDJD Posts: 570
    edited 2009-10-31 00:14
    erdenerus,

    A good program to use to confirm that you have proper Bluetooth connection is the code attached; the BASIC Stamp 2 module listens via the Bluetooth and DEBUGs the value it recieves.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • erdeneruserdenerus Posts: 6
    edited 2009-11-06 20:33
    thanks for your helps.i m able to make the connection now.
Sign In or Register to comment.