Shop OBEX P1 Docs P2 Docs Learn Events
BoeBot Control with MSRS — Parallax Forums

BoeBot Control with MSRS

NWCCTVNWCCTV Posts: 3,629
edited 2010-04-15 06:29 in BASIC Stamp
With the attached code I am suppose to use the EBT 500 to connect the BoeBot and have MSRS control it. My question is this, can this code be modified to use a Comm port instead of a Bluetooth device? If so, how and where do I change it? Thanks in advance for any help.

Comments

  • JDJD Posts: 570
    edited 2010-04-09 23:25
    NWCCTV,

    So you do not want to use the EB500 for communication at all, but rather the programming port on the BASIC Stamp module to send and receive data?

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


    Joshua Donelson
    www.parallax.com
  • erickejaherickejah Posts: 6
    edited 2010-04-10 01:15
    What about using a serial bluetooth adapter? such as www.bhphotovideo.com/c/product/412767-REG/Iogear_GBS301_Serial_Adapter_with_Bluetooth.html you only need to specify the adress of the device at the beginning ie:
    ' =========================================================================
    '
    '   File....... Axial and Reference Voltage
    '   Purpose.... Hitachi H48C 3-Axis Accelerometer (x6) Information gathering for LabVIEW
    '   Author..... Copyright (c) 2009-2010 Hot-n-Ready, Inc.
    '   E-mail..... Erick.Andino@gmail.com
    '   Started.... 02/17/10
    '
    '   {$STAMP BS2}
    '   {$PBASIC 2.5}
    '
    ' =========================================================================
    
    
    ' -----[noparse][[/noparse] Program Description ]---------------------------------------------
    '
    ' This program communicates with the accelerometer to gather information.
    '
    ' -----[noparse][[/noparse] I/O Definitions ]-------------------------------------------------
    
    Dio             PIN     15                      ' data to/from module
    Clk             PIN     14                      ' clock output
    
    ' -----[noparse][[/noparse] Constants ]-------------------------------------------------------
    
    XAxis           CON     0                       ' adc channels
    YAxis           CON     1
    ZAxis           CON     2
    VRef            CON     3
    
    ' -----[noparse][[/noparse] Variables ]-------------------------------------------------------
    
    ax              VAR     Nib                     ' axis selection
    rvCount         VAR     Word                    ' ref voltage adc counts
    axCount         VAR     Word                    ' axis voltage adc counts
    cs              VAR     Word
    ' -----[noparse][[/noparse] Initialization ]--------------------------------------------------
    
    DEBUG "con 00:0C:84:00:05:29",CR                'COM adress
    'WAIT 5000                                      'Wait so the BlueTooth handshakes with PC
    
    ' -----[noparse][[/noparse] Program Code ]----------------------------------------------------
    
    Main:
    
    SEROUT 16,16390, [noparse][[/noparse]"S"]                                          'Start character
    FOR cs = 8 TO 13
        FOR ax = XAxis TO ZAxis                             ' loop through each axis
            'Reset:
            HIGH cs                                         ' deselect module
            'Get_H48C                                       ' read vRef & axis counts
              LOW cs
              SHIFTOUT Dio, Clk, MSBFIRST, [noparse][[/noparse]%11\2, VRef\3]  ' select vref register
              SHIFTIN  Dio, Clk, MSBPOST, [noparse][[/noparse]rvCount\13]      ' read ref voltage counts
             HIGH cs
             'PAUSE 1
             LOW cs
              SHIFTOUT Dio, Clk, MSBFIRST, [noparse][[/noparse]%11\2, ax\3]    ' select axis
              SHIFTIN  Dio, Clk, MSBPOST, [noparse][[/noparse]axCount\13]      ' read axis voltage counts
              HIGH cs
            '------------
    
            IF (ax = 0) THEN                                'DEBUG axis
                SEROUT 16, 16390, [noparse][[/noparse]"x"]
            ELSEIF (ax = 1) THEN
                SEROUT 16, 16390, [noparse][[/noparse]"y"]
            ELSEIF (ax = 2) THEN
                SEROUT 16, 16390, [noparse][[/noparse]"z"]
            ENDIF
            '------------
           SEROUT 16, 16390,[noparse][[/noparse]"r"]
           SEROUT 16, 16390,[noparse][[/noparse]DEC5 rvCount]                          'DEBUG vRef count
           SEROUT 16, 16390,[noparse][[/noparse]"a"]
           SEROUT 16, 16390,[noparse][[/noparse]DEC5 axCount]                          'DEBUG vAxial count
         NEXT
    NEXT
    
    GOTO Main
    
  • NWCCTVNWCCTV Posts: 3,629
    edited 2010-04-10 04:32
    No, I do not want to use anything bluetooth. I have an ITX motherboard with an Atom CPU. This will run the heavier items, but I want to use a serial port connection between the Stamp and the MSRS software.

    ericejah, that link does not work. Howecer, I do not want to spend any more money on this. Tryibg to do it witg parts I already have. Also, I will be using a wireless G adapter and VNC software to control and do not want to be using multiple wireless. Bluetooth has limited distance. I need to be able to control my robot from inside my home while the robot "patrols" outside. I have a high gain outdoor antenna to accomplish this.






    Post Edited (NWCCTV) : 4/10/2010 4:42:19 AM GMT
  • FranklinFranklin Posts: 4,747
    edited 2010-04-11 01:53
    If you want to do it wired just plug a BOE into your computer and you have your connection. Then you use serout 16 instead of the bluetooth code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • NWCCTVNWCCTV Posts: 3,629
    edited 2010-04-15 06:29
    Not sure I follow you. What would this code end up looking like?



    Request_Connect:
    ··· pointer = RequestConnect
    ··· GOSUB Get_Packet
    ··· SEROUT 1, 84, [noparse][[/noparse]STR buffer \5]

    · Confirm_Connect:
    ··· pointer = ConnectionGranted
    ··· GOSUB Get_Packet
    ··· Wait_For_Confirm:
    ····· SEROUT 1, 84, [noparse][[/noparse]255, 0, 1, 0, 0]
    ····· SERIN 0, 84, 20, Wait_For_Confirm, [noparse][[/noparse]WAITSTR buffer \ 2,
    ········································· buffer2, buffer3,
    ········································· buffer4]
    · Request_Packet:
    ··· msgIndex = msgIndex + 1
    ··· pointer = RequestCommand
    ··· GOSUB Get_Packet
    ··· SEROUT 1, 84, [noparse][[/noparse]STR buffer \5]
Sign In or Register to comment.