I bought this thunderous omnidirection mecanum wheel robot, and I mounted it following instructions and a video that provides the manufacturer. Then I changed its HC-02 bluetooth module by a HC-05 slave and master bluetooth module. So I could paired it to the Neursosky headset, which acts in slave mode. The Arduino code reads the level of attention that one put to try to move the robot. Only there are to pass on this level to the left_turn() function or whatever other function which represent the kind of move that you want.
CodeThe quid of the question to read a level of attention between 0 to 100 and convert it in a speed which goes from minimun speed to maximun speed. There are to use the map() function.
//changes the wheels speed and commands lef_turn
void mindwaveSpeed(int attention) {
int control;
control = map(attention, 0, 100, MIN_SPEED, MAX_SPEED); //it is very rare to achieve the top attention
move_speed = control;
left_turn(move_speed);
}
You can watch the measured attention level on the Serial monitor of see it on the serial plotter.
HC-05 configurationIt is the same module I used for the bat car move with your mind.
I obtained the commands to configurate on a HC-05 datasheet. There are to put the baud rate at 57600, that it is the one that uses the headset. Role master obviously, and connect it to the fix MAC address of the headset.
The HC-05 is introduced on the pins slot that there are on the shield for bluetooth and WiFi that is mounted on the Arduino Mega of the robot.
Possible BetteringsThis time I will mention a condition that maybe the manufacturer could solve. The robot is so powerful that screws that hold motors to motherboard can come loose. It would needed screws that screw stronger.
DonatePlease, donate
Comments