Shop OBEX P1 Docs P2 Docs Learn Events
educational group project for all of us that are new to electronics — Parallax Forums

educational group project for all of us that are new to electronics

gennarobasso81gennarobasso81 Posts: 84
edited 2013-06-05 19:58 in Robotics
Hello Every one,

My name is Gennaro. I wanted to see if anyone was up for a group project?

So my idea is pretty simple, we start with the basic boe-bot (and if u dont have one it's not an issue). It is a great introduction to basic and some of the fundimentals of electronics.

My Boe-Bot is very basic. Kit came in the mail; i spent a week or two at night (once the kids and wife were in bed) and finished my Boe-Bot and all the different projects that came with the kit.

This was my first time ever working with electronics or microcontrollers. I will admit however i did read some books on basic electronics and eletronics for beginners...boring stuff....and I fiddled in the basement with a breadboard and some leds and resistors before i bought my boe-bot.

So now my boe-bot is finished and i am looking to do something else. I know there are add-ons to the boe-bot like the gripper and tank wheels...but not what i am looking for.

So i am thinking maybe we built a wireless remote control. I just bought the human interface kit components and a 2x16 LCD...I'm wanting to see if we can make a wireless remote with a joystick and some buttons to execute diferent moves and i was going to use the LCD as well in the remote.


If anyones interested I'd love to hear from you or if anyone has already built one I'd love for you to share your project with us

Thanks
«1

Comments

  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-09 20:07
    IMG_2296.jpg
    IMG_2301.jpg
    IMG_2304.jpg
    IMG_2307.jpg
    IMG_2310.jpg
    IMG_2311.jpg
    IMG_2312.jpg



    here are a few pictures: One is of my Boe-Bot with a Ping, the rest are of the remote control i am building to control my bot. I havent bought the Xbee wireless yet so that is missing from the parts but hopefully u will have a basic idea of the look. Now to start wiring it together and code
    1024 x 683 - 68K
    1024 x 683 - 67K
    1024 x 683 - 54K
    1024 x 683 - 55K
    1024 x 683 - 59K
    1024 x 683 - 85K
    1024 x 683 - 70K
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-10 20:59
    I am testing the two buttons to the LCD with the words "Left Turn" and "Right Turn".

    I have three codes i will copy and paste on here. Two of them i can get to work by themselves. The third is the other two combined. I played around with the code for several nights. I dont know how to get them to work together. Any help would be appreciated

    Code 1:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    Btn1         PIN     1
    
    btn1wrk       VAR     Byte
    main:
    PAUSE 5
    BUTTON btn1, 1, 200, 20, btn1Wrk, 0, No_press
     
    
     IF btn1 = 1 THEN SEROUT 0, 84, ["Left", 13, "Turn"]
                     DEBUG "button 1 pushed"
                     PAUSE 1200
     IF btn1 = 0 THEN SEROUT 0, 84, [12]
                      PAUSE 5
    
    No_Press:
     GOTO main
    



    Code 2:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    Btn2         PIN     2
    
    btn2wrk       VAR     Byte
    main:
    PAUSE 5
    BUTTON btn2, 1, 200, 20, btn2Wrk, 0, No_press
     
    
     IF btn2 = 1 THEN SEROUT 0, 84, ["Right", 13, "Turn"]
                     DEBUG "button 2 pushed"
                     PAUSE 1200
     IF btn2 = 0 THEN SEROUT 0, 84, [12]
                      PAUSE 5
    
    No_Press:
     GOTO main
    



    Code 3: (not working)
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    Btn1           PIN     1
    Btn2           PIN     2
    btn1wrk        VAR     Byte
    btn2wrk        VAR     Byte
     
    main:
    PAUSE 5
    BUTTON btn1, 1, 200, 20, btn1Wrk, 0, No_press
    PAUSE 5
    BUTTON btn2, 1, 200, 20, btn2Wrk, 0, No_press
     
     
    
      IF btn1 = 1 THEN SEROUT 0, 84, ["Left", 13, "Turn"]
                     DEBUG "button 1 pushed"
                     PAUSE 1200
      IF btn1 = 0 THEN SEROUT 0, 84, [12]
                      PAUSE 5
      IF btn2 = 1 THEN SEROUT 0, 84, ["Right", 13, "Turn"]
                     DEBUG "button 2 pushed"
                     PAUSE 1200
      IF btn2 = 0 THEN SEROUT 0, 84, [12]
                      PAUSE 5
    
    No_Press:
     GOTO main
    
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-11 07:36
    worked on this code at work this morning....was just playing around with different ways to write it. I got it to work. There may be a better way to write it, not sure.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    Btn1           PIN     1
    Btn2           PIN     2
    
    btn1wrk        VAR     Byte
    btn2wrk        VAR     Byte
    
    BUTTON btn1, 1, 0, 0, btn1Wrk,0, No_Press
    BUTTON btn2, 1, 0, 0, btn2Wrk,0, No_Press
    
    main:
     IF btn1 =1 THEN
                          DEBUG "button 1 pushed"
                          PAUSE 5
     
     IF btn1 = 1 THEN GOSUB Left_Turn
     
     ENDIF
    
     IF btn2 = 1 THEN
                          DEBUG "button 2 pushed"
                          PAUSE 5
     
     IF btn2 = 1 THEN GOSUB Right_Turn
    
     ENDIF
    No_Press:
     GOTO main
    
    '------------------[subroutine]-------------------------------------
    
    Left_Turn:
     IF  Btn1 = 1 THEN
                          SEROUT 0, 84, ["Left", 13, "Turn"]
                          PAUSE 1200
    
     IF  Btn1 = 0 THEN    SEROUT 0, 84, [12]
                          PAUSE 5
                          RETURN
     ENDIF
    
     Right_Turn:
    
     IF btn2 = 1 THEN
                          SEROUT 0, 84, ["Right", 13, "Turn"]
                          PAUSE 1200
     IF btn2 = 0 THEN     SEROUT 0, 84, [12]
                          PAUSE 5
                          RETURN
    ENDIF
    
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-11 12:23
    code running 1.jpg
    code running 2.jpg



    joystick and buttons seem to be working pretty well...only problem i am having is keeping the lcd from blinking.

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    '---------------[Variables]-----------------------------
    LR            VAR     Word
    UD            VAR     Word
    btn1wrk       VAR     Byte
    btn2wrk       VAR     Byte
    
    '---------------[Constants]-----------------------------
    BUTTON btn1, 1, 0, 0, btn1Wrk,0, No_Press
    BUTTON btn2, 1, 0, 0, btn2Wrk,0, No_Press
    Btn1          PIN     1
    Btn2          PIN     2
     
    
    '----------------[Initialize]---------------------------
    SEROUT 15, 84, [22,12]
     
     
    '-------------------------[Main]---------------------------
    Main:
    HIGH 4
    PAUSE 2
    RCTIME 4, 1, UD
    HIGH 11
    PAUSE 2
    RCTIME 11, 1, LR
    DEBUG HOME, "UD =", DEC UD, CLREOL, CR,
    "LR = ", DEC LR, CLREOL, CR
    IF UD > 25 THEN GOSUB Forward
    IF UD < 25 THEN GOSUB Backwards
    IF UD = 25 THEN GOSUB Clear
    IF LR > 25 THEN GOSUB Right
    IF LR < 25 THEN GOSUB Left
    IF LR = 25 THEN GOSUB Clear
    IF btn1 =1 THEN
    DEBUG "button 1 pushed"
    PAUSE 5
    IF btn1 = 1 THEN GOSUB Left_Turn
    ENDIF
    IF btn2 = 1 THEN
    DEBUG "button 2 pushed"
    PAUSE 50
    IF btn2 = 1 THEN GOSUB Right_Turn
    ENDIF
    No_Press:
     GOTO main
    PAUSE 50
     GOTO Main
     
     
     
    
    '-------------------------[Sub Routine]-----------------------
    Forward:
    SEROUT 15,84, 20, [17, 128, "Forward"]
    PAUSE 200
    RETURN
    Backwards:
    SEROUT 15, 84, 20, [17, 128, "Backwards"]
    PAUSE 200
    RETURN
    Right:
    SEROUT 15, 84, 20, [17, 148, "Right"]
    PAUSE 200
    RETURN
    Left:
    SEROUT 15, 84, 20, [17,148, "left"]
    PAUSE 200
    RETURN
    Clear:
    SEROUT 15, 84, [12,17]
    PAUSE 200
    RETURN
    
    Left_Turn:
    IF  Btn1 = 1 THEN     SEROUT 15, 84, ["Left", 13, "Turn"]
                          PAUSE 1200
    IF  Btn1 = 0 THEN     SEROUT 15, 84, [12]
                          PAUSE 5
                          RETURN
     
    
    Right_Turn:
    IF btn2 = 1 THEN      SEROUT 15, 84, ["Right", 13, "Turn"]
                          PAUSE 1200
    IF btn2 = 0 THEN      SEROUT 15, 84, [12]
                          PAUSE 5
                          RETURN
    
    800 x 598 - 89K
    800 x 598 - 79K
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-18 19:55
    IMG_2393.jpg
    IMG_2391.jpg
    IMG_2395.jpg
    IMG_2396.jpg
    IMG_2398.jpg
    IMG_2399.jpg




    Code for it is :
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
     
    
    '----------------[Initialize]---------------------------
    PAUSE 5
    SEROUT 15, 84, [22,12]
    
    SEROUT 15, 84,50, [22,17, "Hello", 13, "Geno"]
    PAUSE 1000
    
    SEROUT 15, 84, [22,12]
    PAUSE 5
    
    '---------------[Variables]-----------------------------
    LR            VAR     Word
    UD            VAR     Word
    btn1wrk       VAR     Byte
    btn2wrk       VAR     Byte
    
    '---------------[Constants]-----------------------------
    BUTTON btn1, 1, 0, 0, btn1Wrk,0, No_Press
    BUTTON btn2, 1, 0, 0, btn2Wrk,0, No_Press
    Btn1          PIN     1
    Btn2          PIN     2
    stickUD       CON     23
    stickLD       CON     25
    
    '-------------------------[Main]---------------------------
     
    Main:
    
    HIGH 4
    PAUSE 2
    RCTIME 4, 1, UD
    HIGH 11
    PAUSE 2
    RCTIME 11, 1, LR
    DEBUG HOME, "UD =", DEC UD, CLREOL, CR,
    "LR = ", DEC LR, CLREOL
    IF UD > stickUD THEN GOSUB Forward
    IF UD < stickUD THEN GOSUB Backwards
    IF UD = stickUD THEN GOSUB Clear
    IF LR > stickLD THEN GOSUB Right
    IF LR < stickLD THEN GOSUB Left
    IF LR = stickLD THEN GOSUB Clear
    IF btn1 =1 THEN
    DEBUG CR, "Button 1 pushed"
    GOSUB Left_Turn
    DEBUG CLS
    ENDIF
    IF btn2 = 1 THEN
    DEBUG CR, "Button 2 pushed"
    GOSUB Right_Turn
    DEBUG CLS
    ENDIF
    
    No_Press:
     GOTO main
    
    GOTO main 
     
     
     
    
    '-------------------------[Sub Routine]-----------------------
    Forward:
    SEROUT 15,84, 20, [17, 128, "Forward"]
    PAUSE 200
    RETURN
    Backwards:
    SEROUT 15, 84, 20, [17, 128, "Backwards"]
    PAUSE 200
    RETURN
    Right:
    SEROUT 15, 84, 20, [17, 148, "Right"]
    PAUSE 200
    RETURN
    Left:
    SEROUT 15, 84, 20, [17,148, "left"]
    PAUSE 200
    RETURN
    Clear:
    SEROUT 15, 84, [12,17]
    PAUSE 200
    RETURN
    
    Left_Turn:
    IF  Btn1 = 1 THEN     SEROUT 15, 84, ["Left", 13, "Turn"]
                          PAUSE 1200
    IF  Btn1 = 0 THEN     SEROUT 15, 84, [12]
                          PAUSE 5
                          RETURN
     
    
    Right_Turn:
    IF btn2 = 1 THEN      SEROUT 15, 84, ["Right", 13, "Turn"]
                          PAUSE 1200
    IF btn2 = 0 THEN      SEROUT 15, 84, [12]
                          PAUSE 5
                          RETURN
    
    1024 x 683 - 42K
    1024 x 683 - 40K
    1024 x 683 - 74K
    1024 x 683 - 78K
    1024 x 683 - 86K
    1024 x 683 - 81K
  • xanaduxanadu Posts: 3,347
    edited 2012-09-18 20:56
    Nice robot! What kind of group project you thinking?

    You enclose the code in tags like this - [C0DE] paste code here [/C0DE]
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-19 06:27
    Hey Xanadu,

    The first project i was doing was the wireless remote with a joystick. Just though it was a good starting project to help me learn pbasic commands and play around with the boe-bot a bit, aswell as wireless...so kind of a lot of little learning lessons in one project...but still easy to do :)

    I was guessing most people had a boe-bot, seems like the easiest way to get into robotics. After I finish the joystick remote i will probably make a smaller one with tilt control...and maybe a button or two.

    After that i was thinking about using a small project box with a couple of continues servos to make more robots...then see if i can wireless connect them to my boe-bot. So if you are interested in any of those please feel free to jump ahead and post anything you have
  • xanaduxanadu Posts: 3,347
    edited 2012-09-19 07:40
    Wow, I can read you code now lol. A remote is a good idea. I haven't built a tilt controller yet :)

    Check these out for the tilt controller - http://learn.parallax.com/XBeeSumoBot
  • FieldexFieldex Posts: 7
    edited 2012-09-20 08:19
    Hi you both
    I hope its ok when i hop in?
    I'm rather new to electronics, trying to build something myself. I start reading and looking through this thread, and see what will happen.
    How can i post pictures with my comments, i work on ipad only because of my illnes(ms)
    I want to put picture of my self build remote unit
    Regards
    Fieldex
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-20 08:39
    well if there is anything i can do to help you get started please let me know
  • xanaduxanadu Posts: 3,347
    edited 2012-09-20 14:09
    Fieldex wrote: »
    Hi you both
    I hope its ok when i hop in?
    I'm rather new to electronics, trying to build something myself. I start reading and looking through this thread, and see what will happen.
    How can i post pictures with my comments, i work on ipad only because of my illnes(ms)
    I want to put picture of my self build remote unit
    Regards
    Fieldex

    If you see a 'go advanced' button under the editor window click it. Once you're in advanced mode there is a picture icon you can use to upload or link an image online. Not sure if Safari on the iPad will work with it but if it doesn't just sign up for a free image hosting account and insert the URL from the image into the post.
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-21 14:57
    hey Fieldex,

    Sorry i didnt give u a good response. Let me start by saying hi :) glad you're reading the thread. I am not sure how to post off of an ipad...but excited to see your pics
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-21 14:58
    Ok, just got my parallax shipment in the mail. I'm working a 24 hour shift at the firehouse so i wont get to play with any of it until tomorrow...but i'm goin away camping for a week so i'll get to it by thursday. And hopefully soon after i'll have a working remote :)
  • FieldexFieldex Posts: 7
    edited 2012-09-23 05:14
    Thanks xanadu,

    I've to get more familiar with the forum program but with help, i"ll finally get there

    I appreciate all help so funny just see the go advanced button i will try to launch first picture
    Sorry but does not work from ipad. Will try your other sufestion later, or get back to laptop

    Kind regards
  • kwinnkwinn Posts: 8,697
    edited 2012-09-23 12:28
    @Fieldex

    You should be able to upload files from the ipad. It may be that the settings for your firewall do not allow the popup window used for the uploads to open. I do not use an ipad myself so I cannot give you any details on how to fix it, but I do know someone that uses it to upload pictures and other files.
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-28 13:13
    ok....so i got my xbee's....been playing around with them for a day or so...not so hard to use....just make sure you read through the parallax xbee manual. Should have some pics up in a few days...hopefully i'll be done with this project in less then a week :)
  • Martin_HMartin_H Posts: 4,051
    edited 2012-09-28 13:29
    How did I miss this neat project? Anyway, I like your home brew remote control.
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-30 17:49
    Martin_H wrote: »
    How did I miss this neat project? Anyway, I like your home brew remote control.

    thank you
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-30 17:53
    Ok so i have my xbee's been playing with them for a few days. I dont have any pics to load right now but here is the code i'm working on to light two led's with two push buttons. You need two bs2.
    ' ***************************************************
    ' Simple_Control_Remote.bs2
    ' Receives decimal value to control buzzer and LED
    ' ***************************************************
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    #SELECT $STAMP
    #CASE BS2, BS2E, BS2PE
    T9600 CON 84
    #CASE BS2SX, BS2P
    T9600 CON 240
    #CASE BS2PX
    T9600 CON 396
    #ENDSELECT
    ' ***************** Variables, Constants and Pins
    Baud CON T9600 ' Set Baud rate
    Rx PIN 15 ' XBee DOUT
    Tx PIN 14 ' XBee DIN
    Led PIN 0
    Led1 PIN 1
    green VAR Byte
    red   VAR Byte
    ' ***************** Main Loop
    DO
    SERIN Rx, Baud,  [DEC green]  ' Wait for decimal and accept
    HIGH LED ' Turn on LED
    PAUSE 1000
    LOW LED ' Turn off LED
    SERIN Rx, Baud, [DEC red]
    HIGH Led1
    PAUSE 1000
    LOW Led1
    LOOP
    

    this is for the receiving bs2
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-30 17:54
    transmitting bs2
    ' ***********************************************
    ' Simple_Control_Base.bs2
    ' Sends changing frequency when button pressed
    ' ***********************************************
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    #SELECT $STAMP
    #CASE BS2, BS2E, BS2PE
    T9600 CON 84
    #CASE BS2SX, BS2P
    T9600 CON 240
    #CASE BS2PX
    T9600 CON 396
    #ENDSELECT
    ' ***************** Variables, Constants and Pins
    Baud CON T9600 ' Set baud rate
    Rx PIN 15 ' XBee DOUT
    Tx PIN 14 ' XBee DIN
    PB PIN 6 ' Pushbutton
    PB1 PIN 7
    green CON 1
    red CON 2
    ' ***************** Main Loop
    DO
    IF PB = 1 THEN ' If button pressed...
    SEROUT Tx, Baud,[DEC green,CR] ' Send Frequency as decimal
    PAUSE 500 ' Short delay
    ENDIF
    IF PB1 = 1 THEN
    SEROUT Tx, baud, [DEC red,CR]
    ENDIF
    LOOP
    
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-09-30 20:48
    so i found a problem with these codes.

    the initial intent was to have one push button turn on one color led and the other turn on another color led. Unfortunately its not working out that way. It's alternating between the two colors regardless of what button pressed or what order pressed in. Any help with Xbee code would be great
  • FieldexFieldex Posts: 7
    edited 2012-10-01 08:43
    hi, everyone,

    sorry it took so long for me to get back to you, but here i am. with the first picture of my self designed
    reemote control unit, not finnishe yet but coming there. start this week with joysticks and xbee.

    my goal is I ike to make a radio controlled vehicle(small not to heavy) equiped with camera eventually small gripper, that I can sent to places, where I can’t
    come with my wheelchair, to make pictures movies, watch annimals, and maybe pickup little things etc ets. and secondly monitoring in and around the house, partially
    autonomously, and via wifi with no background in mechanic technics and electro technics, it is very hard to find answers for all kind of problems that I com across.
    during my internet searches I ended on the parallax forum . what you show there, and write their makes me feeling confident that the idea I have can be worked out..
    before going any further my posts and replies may always take some time, as explained in mij profile.
    Nevertheless i will checkand read the forumtopic several times a day.
    this is the first time that i'm really have the idea that i talk to people who think along same lines.
    more pictures will follow later this week.
    today got my xbees in the mail i hope to get to testing tommorow. thanks for your help

    bye for now
    fieldex
    2012-10-01 15.57.38.jpg
    1024 x 768 - 32K
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-10-01 19:25
    Hey Fieldex,

    glad to see you are posting ur project on here. Look forward to seeing more.

    As for my remote...I remade the control board. schematics were taking right from parallax pdf's

    IMG_2420.jpg
    IMG_2421.jpg
    IMG_2422.jpg
    IMG_2423.jpg
    1024 x 1536 - 123K
    1024 x 683 - 88K
    1024 x 683 - 84K
    1024 x 683 - 87K
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-10-03 21:02
    Ok so the next step in the project is the wireless. It's definately slow coming. I actually though i would have had it all done by now...lol

    wireless test with the xbees (Learning how to use them): make one xbee with buttons to transmit and turn on leds on the other xbee.

    IMG_2423.jpg
    IMG_2424.jpg
    IMG_2425.jpg



    Transmitting Xbee and BS2
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
     
    
    '----------------[Initialize]---------------------------
    PAUSE 5
    SEROUT 2, 84, [22,12]
    
    SEROUT 2, 84,50, [22,17, "Hello", 13, "Geno"]
    PAUSE 1000
    SEROUT 2, 84, [22,12]
    PAUSE 5
    '---------------[Variables]-----------------------------
    LR            VAR     Word
    UD            VAR     Word
    btn1wrk       VAR     Byte
    btn2wrk       VAR     Byte
    Led           VAR     Bit
    Led1          VAR     Bit
    
    '---------------[Constants]-----------------------------
    BUTTON btn1, 1, 0, 0, btn1Wrk,0, No_Press
    BUTTON btn2, 1, 0, 0, btn2Wrk,0, No_Press
    LCD           PIN     2
    Btn1          PIN     6
    Btn2          PIN     7
    Tx            PIN     14 ' XBee DIN
    Rx            PIN     15 ' XBee DOUT
    stickUD       CON     25
    stickLD       CON     25
     
    
    '-------------------------[Main]---------------------------
     
    Main:
    
    HIGH 13
    PAUSE 2
    RCTIME 13, 1, UD
    HIGH 12
    PAUSE 2
    RCTIME 12, 1, LR
    DEBUG HOME, "UD =", DEC UD, CLREOL, CR,
    "LR = ", DEC LR, CLREOL
    IF UD > stickUD + 2 THEN GOSUB Forward
    IF UD < stickUD - 2 THEN GOSUB Backwards
    IF UD = stickUD     THEN GOSUB Clear
    IF LR > stickLD + 2 THEN GOSUB Right
    IF LR < stickLD - 2 THEN GOSUB Left
    IF LR = stickLD     THEN GOSUB Clear
    IF btn1 =1 THEN
    DEBUG CR, "Button 1 pushed"
    GOSUB Left_Turn
    DEBUG CLS
    ENDIF
    IF btn2 = 1 THEN
    DEBUG CR, "Button 2 pushed"
    GOSUB Right_Turn
    DEBUG CLS
    ENDIF
    
    No_Press:
     GOTO main
    
    GOTO main
    
    '-------------------------[Sub Routine]-----------------------
    Forward:
    SEROUT 2,84, 20, [17, 128, "Forward"]
    PAUSE 200
    RETURN
    Backwards:
    SEROUT 2, 84, 20, [17, 128, "Backwards"]
    PAUSE 200
    RETURN
    Right:
    SEROUT 2, 84, 20, [17, 148, "Right"]
    PAUSE 200
    RETURN
    Left:
    SEROUT 2, 84, 20, [17,148, "left"]
    PAUSE 200
    RETURN
    Clear:
    SEROUT 2, 84, [12,17]
    PAUSE 200
    RETURN
    
    Left_Turn:
    IF  Btn1 = 1 THEN     SEROUT 2, 84, ["Left", 13, "Turn"]
                          SEROUT Tx, 84,[DEC 0,CR]
                          PAUSE 500
    IF  Btn1 = 0 THEN     SEROUT 2, 84, [12]
                          PAUSE 5
                          RETURN
     
    
    Right_Turn:
    IF btn2 = 1 THEN      SEROUT 2, 84, ["Right", 13, "Turn"]
                          SEROUT Tx, 84, [DEC 1,CR]
                          PAUSE 500
    IF btn2 = 0 THEN      SEROUT 2, 84, [12]
                          PAUSE 5
                          RETURN
    


    Receiving Xbee and BS2
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    ' ***************** Variables, Constants and Pins
    Rx PIN 15 ' XBee DOUT
    Tx PIN 14 ' XBee DIN
    green PIN 0
    red   PIN 1
    Led   VAR Bit
    Led1  VAR Bit
    ' ***************** Main Loop
    DO
    SERIN Rx, 84, [DEC Led]
    SERIN Rx, 84, [DEC Led1]
    IF Led = 0 THEN
    HIGH green ' Turn on LED
    PAUSE 1000
    LOW green ' Turn off LED
    ENDIF
    IF led = 0 THEN
    SEROUT Tx, 84,[DEC 0,CR]
    PAUSE 1000
    ENDIF
    IF Led1 = 1 THEN
    HIGH red
    PAUSE 1000
    LOW red
    SEROUT Tx, 84,[DEC 1,CR]
    ENDIF
    LOOP
    

    The code works. If i press button 1 the green led goes on...if i press button 2 the red led goes on.
    1024 x 683 - 87K
    1024 x 683 - 104K
    1024 x 683 - 63K
  • FieldexFieldex Posts: 7
    edited 2012-10-19 07:21
    Hello Gennaro,

    Sorry it took a while, but here i am again.

    In the meantime i"ve got my xbees in, and did all the test described in the paralax xbee tut., and all worked fine.
    From here there are two ways to go. First i like to finnish my remote control, and try to let 1 basic stamp control another basic stamp (boe. Bot)
    Via the xbees. I presume that is what you are doing? Is that correct?

    Regards
    Jean
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-11-22 09:42
    Sorry Everyone for not being on in a while. I had a baby then a week later was hit with hurricane Sandy then a snow storm. Trying to get back to normal life now. I will start working on this project again this week.

    Jean,

    yes, you are correct. I want to use one BS2 (remote) to control another BS2 (Boe-Bot). My friend Graffix aslo purposed a very cool idea. (I hope he doesnt mind me saying this) He is using a second 2-axis joystick to control the Ping servo....looks great Graffix!
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2012-11-24 22:22
    Hello again everyone,

    If you are following along with the project I am happy to say i got the remote working. I am able to control my Boe-bot. I will admit it's not finished. I am only using the 2 axis joystick to wirelessly control two servos but i am able to wirelessly control the bot. I would still like to add some features like the informational LCD and some buttons but i think i am going to change direction with their use. I was reading Graffix post under the forum wireless and liked his idea to use another joystick to contol the ping and use the lcd to see the pings info. check out his post if u are interested. Anyway here is my code for what i have so far. Maybe later this week i will put it all together to look nice and post a video or some pics

    base
    ' Xbee Servo Base test #1
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    '----------------[Initialize]---------------------------
    PAUSE 5
    SEROUT 2, 84, [22,12]
    SEROUT 2, 84,50, [22,17, "Hello", 13, "Geno"]
    PAUSE 1000
    SEROUT 2, 84, [22,12]
    PAUSE 5
    '---------------[Variables]-----------------------------
    LR            VAR     Word
    UD            VAR     Word
    btn1wrk       VAR     Byte
    btn2wrk       VAR     Byte
    Led           VAR     Bit
    Led1          VAR     Bit
    '---------------[Constants]-----------------------------
    BUTTON btn1, 1, 0, 0, btn1Wrk,0, No_Press
    BUTTON btn2, 1, 0, 0, btn2Wrk,0, No_Press
    Btn1          PIN     6
    Btn2          PIN     7
    RTS           PIN     10
    Tx            PIN     14 ' XBee DIN
    Rx            PIN     15 ' XBee DOUT
    stickUD       CON     25
    stickLD       CON     25
    '-------------------------[Main]---------------------------
    Main:
    DO
    HIGH 13
    PAUSE 2
    RCTIME 13, 1, UD
    HIGH 12
    PAUSE 2
    RCTIME 12, 1, LR
    DEBUG HOME, "UD =", DEC UD, CLREOL, CR,
    "LR = ", DEC LR, CLREOL
    SEROUT tX, 84, [UD]
    SEROUT Tx, 84, [LR]
    LOOP
    
    

    Remote (Note: the base is the remote control and the remote is the boe bot)
    'Xbee Servo Remote test #1
    
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    #SELECT $STAMP
    #CASE BS2, BS2E, BS2PE
    T9600 CON 84
    #CASE BS2SX, BS2P
    T9600 CON 240
    #CASE BS2PX
    T9600 CON 396
    #ENDSELECT
    
    '---------------[Variables]-----------------------------
    LR            VAR     Word
    UD            VAR     Word
    btn1wrk       VAR     Byte
    btn2wrk       VAR     Byte
    Led           VAR     Bit
    Led1          VAR     Bit
    '---------------[Constants]-----------------------------
    BUTTON btn1, 1, 0, 0, btn1Wrk,0, No_Press
    BUTTON btn2, 1, 0, 0, btn2Wrk,0, No_Press
    Btn1          PIN     6
    Btn2          PIN     7
    RTS           PIN     10
    Tx            PIN     14        ' XBee DIN
    Rx            PIN     15        ' XBee DOUT
    stickUD       CON     25
    stickLD       CON     25
    Baud          CON     T9600     'Set Baud Rate
    ' ***************** Main Loop
    Main:
    DO
    SERIN Rx, 84, [UD, LR]
    
    DEBUG HOME, "UD =", DEC UD, CLREOL, CR,
    "LR = ", DEC LR, CLREOL
    
    IF UD > stickUD +2       THEN GOSUB Forward
    IF UD < stickUD -2       THEN GOSUB Backwards
    IF UD = stickUD +2 OR -2 THEN GOSUB Stay
    IF LR > stickLD +2       THEN GOSUB Right
    IF LR < stickLD -2       THEN GOSUB Left
    IF LR = stickLD +2 OR -2 THEN GOSUB Stay
    LOOP
     
    NO_Press:
    GOTO Main
    '-------------------------[Sub Routine]-----------------------
    Forward:
      PULSOUT 13, 850
      PULSOUT 12, 650
      PAUSE 20
      RETURN
    Backwards:
      PULSOUT 13, 650
      PULSOUT 12, 850
      PAUSE 20
    RETURN
    Right:
      PULSOUT 13, 848
      PULSOUT 12, 850
      PAUSE 20
    RETURN
    Left:
      PULSOUT 13, 650
      PULSOUT 12, 650
      PAUSE 20
    RETURN
    Stay:
      PULSOUT 13, 750
      PULSOUT 12, 750
      PAUSE 20
    RETURN
    
  • waleedfakhrwaleedfakhr Posts: 9
    edited 2013-02-07 00:23
    dear gennarobasso81

    nice project. Many thanks for all the info.
    If I want to control the boe-bot using inputs from a program on my PC, would the same arrangement work? I mean, the sender Xbee would be connected to the PC and takes
    the data from the program, while the receiver Xbee would be connected on the Boe-Bot board?

    many thanks

    Waleed
  • gennarobasso81gennarobasso81 Posts: 84
    edited 2013-06-02 11:03
    sorry to anyone that was communicating with me on this thread. I was in a bad car accident. Unfortunately I had my laptop and a box with all of my electronics in the car. I made it out without a scratch....the car was totaled and my Boe-Bot as well as most of the other electronics, including the laptop, didn't make it. However I just bought a new laptop and a P8X32A quickstart board...so I'm going back to square one and starting all over again using the propeller chip. Hope to hear from all of you again. My email is gennarobasso81@gmail.com . Email me if you'd like
  • xanaduxanadu Posts: 3,347
    edited 2013-06-02 12:30
    dear gennarobasso81

    nice project. Many thanks for all the info.
    If I want to control the boe-bot using inputs from a program on my PC, would the same arrangement work? I mean, the sender Xbee would be connected to the PC and takes
    the data from the program, while the receiver Xbee would be connected on the Boe-Bot board?

    many thanks

    Waleed

    You could plug the XBee directly into the PC and control the robot using X-CTU like I usually do - http://youtu.be/8opDCNzlnIg

    Or you could use the PC to communicate with a Basic Stamp via serial or USB and have the Stamp Control the XBee. You may find one way works better than the other so it's best to try both :)
Sign In or Register to comment.