Control Boe Bot with Android Phone via Bluetooth module?
kwalseth
Posts: 7
I am trying to program my Boe Bot with my cell phone for a class project. Any ideas as to how this will work, or will it at all? My bluetooth module will be here within the next few days, but i am not sure what program to install on my phone or how to go about making this work... any advice??
Comments
Then you need to get the bluetooth of the phone to detect and link with the bluetooth module.
If you don't really know how to program the BoeBot, start with that ... you'll actually save some time doing so. The "What's a Microcontroller?" tutorial is a good place to start. It's included in the Stamp Editor's help files and you can download it from Parallax's Downloads webpage.
Everybody and their brother wants to get their Android phone to "do things". Sounds like you came up with an easy solution!
I have the parallax easy bluetooth module, HTC Aria phone, and cell bots app from android market.
' {$STAMP BS2}
' {$PBASIC 2.5}
direction VAR Word
x var word
RX CON 2
TX CON 0
Baud CON 84
main:
DO
SERIN RX, Baud, [direction]
SEROUT TX, Baud, [direction]
DEBUG direction
IF direction = %01100110 THEN GOSUB forward
IF direction = %01110010 THEN GOSUB right
IF direction = %01101100 THEN GOSUB left
IF direction = %01100010 THEN GOSUB back
IF direction = %01110011 THEN GOSUB stoping
LOOP
forward:
FOR x = 0 TO 1000:
PULSOUT 12, 500
PULSOUT 13, 1000
NEXT
GOTO main
right:
FOR x = 0 TO 500:
PULSOUT 12, 500
PULSOUT 13, 500
NEXT
GOTO main
left:
FOR x = 0 TO 500
PULSOUT 12, 1000
PULSOUT 13, 1000
NEXT
GOTO main
back:
FOR x = 0 TO 100
PULSOUT 12, 1000
PULSOUT 13, 500
NEXT
GOTO main
stoping:
PULSOUT 12, 750
PULSOUT 13, 750
GOTO main
' {$STAMP BS2}
' {$PBASIC 2.5}
direction VAR Word
x VAR Word
y VAR Word
RX CON 2
TX CON 0
Baud CON 84
main:
DO
SERIN RX, Baud, 20, No_Data, [direction]
No_Data:
y = 0
DEBUG direction
IF direction = %01100110 THEN GOSUB forward
IF direction = %01110010 THEN GOSUB right
IF direction = %01101100 THEN GOSUB left
IF direction = %01100010 THEN GOSUB back
IF direction = %01110011 THEN GOSUB stoping
LOOP
forward:
PULSOUT 12, 500
PULSOUT 13, 1000
RETURN
right:
PULSOUT 12, 1000
PULSOUT 13, 1000
RETURN
left:
PULSOUT 12, 500
PULSOUT 13, 500
RETURN
back:
PULSOUT 12, 1000
PULSOUT 13, 500
RETURN
stoping:
PULSOUT 12, 750
PULSOUT 13, 750
RETURN
Looked up and down this thread, nobody stated this as being impossible.
You were urged to get in there and get to work, to take ownership and make it happen.
Good on you, kwalseth!
This is pretty cutting edge stuff.
I've got an android "epad" ("apad", "pandapad") which cost me $110 including shipping, and it can do some cool things including being programmable with Basic4Android via wifi. But it doesn't have bluetooth. Pay another $50 and you can get a pandapad with bluetooth, and this opens up some amazing possibilities. Real world control of a basic stamp or propeller via a device with a hi res touchscreen. UAV for the masses, here we come!
I've paired a Bluetooth module with a PC and Bluetooth devices with my Android tablet. The process is similar on both, so I would imagine that when you pair the Easy Bluetooth module with the phone it creates a new serial port on the phone much like it does on the PC.
My problem is that I can pair PC and module, phone and PC, because Android finds only PC after the Bluetooth scan.
Maybe you rooted your Android?
How did the module look in the Android Bluetooth scan results? Which version of module do you have? Mine is eb500-SER D.