I own a 'Sparkfun´s Bluetooth Mate Gold'. Now I want to drive a DC-Motor using the BT-Communication.
When I send a short command like an "w" it turn right for a short time.
BUT when I hold the "w"-button as long as about 2sec, it turns right for more than 10seconds and not for 2!!!
I think the problem is the Bluetooth-Buffer. Is there a way to clean it or to drive the motor for exactly that time, i hold the keyboard-button?
When I send a short command like an "w" it turn right for a short time.
Using what to send the data?
Using what code on the Arduino?
The communication between the PC and the bluetooth device and between the bluetooth device and the Arduino is serial. If you send a letter over and over as long as a key is held down, you will be sending lots of letters. You will need to receive and read all of them before you can quit acting on them.
Far better to send one code when a key is pressed and another when a key is released. Like, send 'a' when the a key is pressed, and send 'A' when it is released.
Then, the Arduino can start something happening when it gets a lower case letter, and stop it when it gets an upper case letter.