Reputation: 125
I have written an application for Android in Java using Eclipse to send data to an Arduino via Bluetooth.
The devices seem to be connected okay, but when I send data from the Android to the Arduino the receive (RX) light on the Arduino board doesn't light up.
Can someone help?
#define arduinoRx 2
#define arduinoTx 3
int gelen_veri;
int LedCikis = 8;
SoftwareSerial bluetooth(arduinoRx, arduinoTx);
void setup() {
bluetooth.begin(9600);
}
void loop() {
if (bluetooth.available() > 0) {
gelen_veri=bluetooth.read();
switch (gelen_veri) {
case 'A' :
digitalWrite(LedCikis, HIGH);
break;
case 'K' :
digitalWrite(LedCikis, LOW);
break;
default:
break;
}
}
}
Upvotes: 2
Views: 1055
Reputation: 21
Use the serial rx/tx pins instead of SoftwareSerial. I've had problems with SoftwareSerial in the past and my HC-05 bluetooth module.
Upvotes: 1