I am trying to send a message from my arduino via bluetooth to my android app that I wrote. Here is my sketch:
int ledPin = 13;
int buttonPin = 8;
byte leds = 0;
void setup()
{
Serial.begin(9600); //note this may need to be changed to match your module
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT_PULLUP);
}
void loop()
{
if (digitalRead(buttonPin) == LOW)
{
Serial.println("BUTTON PUSHED");
digitalWrite(ledPin, HIGH);
}
if (digitalRead(buttonPin) == HIGH)
{
Serial.println("NO BUTTON");
digitalWrite(ledPin, LOW);
}
}
When I load my android app, it finds my arduino and asks me to pair it. I can see the 'no button' text on the phone, but when I push the button nothing happens. I don't receive anything. I am thinking it has to do something with the arduino sketch.