Shop OBEX P1 Docs P2 Docs Learn Events
Visual Basic control the servo motor using EB500 Bluetooth — Parallax Forums

Visual Basic control the servo motor using EB500 Bluetooth

hsiaochunghsiaochung Posts: 17
edited 2007-07-21 17:36 in BASIC Stamp
I write a bs2 program and visual basic program
By using a EB500 with board of Education(BOE) and a bluetooth dongle connected with PC

I launch my visual basic program and write the bs2 program into BOE

I click the forward , backward , left turn , right turn

It is ok , but for a while after·several moves,

THE Connected led on the EB500 will extinguish

Why ?

I have replaced serval bluetooth dongles to test
But above situation also exist

Comments

  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-07-18 10:44
    It looks like your overflowing the stack.

    replace "GOSUB main "
    with "RETURN"

    Each GOSUB must have a RETURN

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR
  • hsiaochunghsiaochung Posts: 17
    edited 2007-07-18 13:03
    Thanks for TechnoRobbo's suggestion

    But it does not work
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-07-18 23:46
    You should print your code so others can help it should look like this below·with·a RETURN on the end. Also run the servo power from a different power source than the stamp - the load could be too much. Make sure you tie the·grounds together.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    command VAR Byte
    main:
    · DO
    ··· SERIN 0, 84 ,10 ,move, [noparse][[/noparse]command]
    ··· 'DEBUG DEC command
    ··· GOSUB move
    · LOOP
    move:
    · SELECT command
    ··· CASE 1 'Forward
    ····· DEBUG "f"

    ····· PULSOUT 13, 850
    ····· PULSOUT 12, 650
    ····· PAUSE 20

    ··· CASE 2 'Left Turn
    ····· DEBUG"l"

    ····· PULSOUT 13, 850
    ····· PULSOUT 12, 850
    ····· PAUSE 20

    ··· CASE 3 'Right Turn
    ····· DEBUG"r"

    ····· PULSOUT 13, 650
    ····· PULSOUT 12, 650
    ····· PAUSE 20

    ··· CASE 4 'Backward
    ····· DEBUG "B"

    ······ PULSOUT 13, 650
    ······ PULSOUT 12, 850
    ······ PAUSE 20
    ··· CASE 5 'Stop
    ····· DEBUG "s"
    ····· PULSOUT 13, 750
    ····· PULSOUT 12, 750
    ····· PAUSE 20

    · ENDSELECT
    ·RETURN

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR

    Post Edited (TechnoRobbo) : 7/19/2007 2:11:38 AM GMT
  • hsiaochunghsiaochung Posts: 17
    edited 2007-07-21 14:39
    I have ran the servo power by another power
    no use
    any other suggestion
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-07-21 17:36
    Hello,

    It would those who are trying to help you if when a suggestion didn’t work you provided more detail as to why or what happened. Responses of “it does not work” and “no use, any other suggestion” don’t convey why the suggestions didn’t work making it difficult to offer anything additional. I hope this helps you to get your problem solved. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.