Shop OBEX P1 Docs P2 Docs Learn Events
Bluetooth Effecincy Formula — Parallax Forums

Bluetooth Effecincy Formula

GeorgeLGeorgeL Posts: 131
edited 2009-03-22 20:33 in BASIC Stamp
Building a simple prototype for my army of swarm-bots, and wanted to share some progress and code.
I have found the Bluetooth is quite laggy in the sense of sending huge amounts of data, and rather than trying to time evreything I have all my data sent in one value.
It is a good example (IMO) for a way to communicate between computers/other devices in general.

In this example I have two values I want to know: the commands to occur ( in this case demo's) and the ammount specific to that demo.

type····VAR Word
number VAR Word

SERIN 0,84,[noparse][[/noparse]WAIT("!"),DEC number]
type = (number DIG 3 )
number = number - (type*1000)
DEBUG DEC type, CR, DEC number, CR 'for debugging whats recieved
type = type - 1
number = number - 1
ON type GOSUB life, ping, life


This is just·a simple example, of course the value can be bigger, and in essence send more complicated tasks.

Attached is the full code for this part of the project, along with VB2008 express (free from microsofts site) project file. To use the accompanying vb program, make sure to change the serial port from COM7 to what you have.

Comments

  • GeorgeLGeorgeL Posts: 131
    edited 2009-03-22 20:33
    Here is a video demonstarting the above code and a few more features I made:
Sign In or Register to comment.