Im working on a swarm robotic project for 2 robots but im facing some problems hope you guys can help me out,
the basic idea about the project is that there are 2 robots robot A and B they are in a arena where there are a 2 yellow and a 2 blue balls the arena is divided in to two parts each part of the arena has a blue and a yellow ball and a robot . robots cant see the other and the task is one has to pick the blue one and the other has to pick the yellow one if one pick the blue one he has to tell the other on to pick the yellow one.
so far i made 2 sensors home using photo resistors the are working great it prints out whether its blue or yellow on the serial monitor i want o transmit the data to another arduino for it to make a desicion whether which ball to pick.
Im hoping to use bluetooth to commmunicate with the robots.
hey ,
well the problem this is the first time im using 2 arduinos to work together ,I dont have much programming so how should i start,if you can give me a tutorial for arduinos communicate with each other it would be great.
thanks
You should start learning serial communicating first before doing BT imho, get a good understanding of how to interpret a stream of bytes with information from the other side. THis is so elementary for communication and can be used in every communicationprotocol/
It is also good to learn to work in packets of data. A packet is a group of bytes with a start and a stop character e.g.
< | FROM | TO | LENGTH | DATA .... | CRC| > or somewhat simpler < | LENGTH | DATA .... | >
The packet starts with < then a byte indicating the sender, then a byte indicating the recepient, the length of the message, then a number of databytes followed by a CRC (checksum) and a > .
A packet allways has at least 6 bytes (depends on LENGTH) in the first example and 3 bytes in the second example. If a byte is lost you can allways synchronize by reading until you encounter a > character.
i guess the principal idea here is not solve and i have the same problem, i would like to know how can i communicate two arduinos over bluetooh, i already have BTMate, but i don't know how to make them recognize each other..i would really aprecciate your help.