So I was playing around with the HC-05 BT module and MIT App Inventer 2. I'm trying to make Arduino Pins toggle HIGH/LOW.
When my Arduino code request a "0" I have to sent a "48" in App Inventor
When my Arduino code request a "1" I have to sent a "49" in App Inventor
When my Arduino code request a "2" I have to sent a "50" in App Inventor
When my Arduino code request a "3" I have to sent a "51" in App Inventor
When my Arduino code request a "4" I have to sent a "52" in App Inventor
When my Arduino code request a "5" I have to sent a "53" in App Inventor
and so on
Why can't I send a "1" in App Inv. and request a "1" in Arduino. Is there some sort of conversion?
Thanks
Code:
#include <SoftwareSerial.h>
SoftwareSerial Brown(10, 11); // RX TX
int ledpin=13;
int BluetoothData;
void setup() {
Brown.begin(9600);
Brown.println("Bluetooth On please press 1 or 0 blink LED ..");
pinMode(ledpin,OUTPUT);
}
void loop() {
if (Brown.available()){
BluetoothData=Brown.read();
if(BluetoothData=='0'){
digitalWrite(ledpin,1);
Brown.println("LED On D13 ON ! ");
}
if (BluetoothData=='1'){
digitalWrite(ledpin,0);
Brown.println("LED On D13 Off ! ");
}
}
delay(100);
}