Hello everyone I'm new to this. And I can't connect the code together.
I wanted to do voice control and control via Bluetooth HC-06. The code works separately. And if you connect no. ESP8266 nodemcu microcontroller. I want to make a single code
Voice control:
byte com = 0;
void setup() {
Serial.begin(9600);
Serial.write(0xAA);
Serial.write(0x37);
delay(1000);
Serial.write(0xAA);
Serial.write(0x21);
}
void loop() {
while (Serial.available()) {
com = Serial.read();
switch (com) {
case 0x11:
Serial.println("1");
break;
case 0x12:
Serial.println("2");
break;
case 0x13:
Serial.println("3");
break;
case 0x14:
Serial.println("4");
break;
case 0x15:
Serial.println("5");
break;
}
}
}
Start from the bluetooth code.
At the end of loop You paste the content of the other loop.
Do the same for setup.
Do the same for declarations.
Delete duplicates like Serial.begin.
I don't understand You. Follow the instructions in reply #2, line by line. Then You will have all the code in one sketch. Give it a new name and save it.