Hi people!
I'm building a project using HC 06 bluetooth module. I already got a way to connect to module without trouble, but when i use my Android app (Bluetooth RC Controller from Playstore) to controll a RC car, i get some strange characters like "!, :, #, $, %, &, (, )" everytime when i press any application button.
Code:
#include <Servo.h>
#include <SoftwareSerial.h>
SoftwareSerial HC06(0, 1);
Servo myS;
int d = 1000;
// [0][1]
const byte me[2] = {7, 8}; //Left Motor
const byte md[2] = {5, 6}; //Right Motor
char cmd;
void setup() {
myS.attach(9);
myS.write(90);
Serial.begin(9600);
Serial.println("Serial ready.");
HC06.begin(9600);
Serial.println("Bluetooth ready.");
pinMode(me[0], OUTPUT);
pinMode(me[1], OUTPUT);
pinMode(md[0], OUTPUT);
pinMode(md[1], OUTPUT);
}
void loop() {
//stores bluetooth buffer to cmd variable
while(HC06.available() > 0) {
cmd = Serial.available();
Serial.print("Command: ");
Serial.println(cmd);
}
}
Serial Monitor printscreen: Imgur: The magic of the Internet
Someone can help me please?
PS: after often pressing the application button, I get only characters like '?' and stops there.