Hello everyone, I am almost done with my ir remote controller project but I am now stuck in trying to make my remote work via Bluetooth; without having to connect my Arduino, IR receiver and IR transmitter.
I found a code that is for Bluetooth setup and here is the loop of it:
void loop()
{
char recvChar;
while(1){
if(blueToothSerial.available()){//check if there's any data sent from the remote bluetooth shield
recvChar = blueToothSerial.read();
Serial.print(recvChar);
}
if(Serial.available()){//check if there's any data sent from the local serial terminal, you can add the other applications here
recvChar = Serial.read();
blueToothSerial.print(recvChar);
}
}
}
And as for my project code itself for the remote controller, here it is:
void loop() {
if (Serial.available() && Serial.read() == '0') { /////here is the transmiiting part
while (Serial.available() == 0) {
}
delay(50);
while (Serial.available() > 0) {
readString += (char)Serial.read();
}
value= readString.toInt();
Serial.print(readString);
readString = "";
for (int i = 0; i < 3; i++) {
irsend.sendNEC(value,32);
delay(40);
}
}while (irrecv.decode(&results)) { //////here is the receiving part
Serial.println(results.value);
irrecv.resume();
}
}
I am having trouble understanding what to give to the bluetooth and what the bluetooth will give me...i mean i just cant integrate it!