Bluetooth Effecincy Formula
GeorgeL
Posts: 131
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.
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.
zip
80K
Comments