I have a newb question and I'm guessing a simple mistake
this is my first project and the code below works perfect and communicates with the app I wrote but I'm trying to expand it and add an LED strip and the app will have about 40 buttons to select different colors.
The single letter or number works fine now but obviously with the way it written I'm going to run out of letters when I add the strip after searching I thought changing to say if(BluetoothData=="drive") should have fixed it but I get the ISO C++ forbids comparison between pointer and integer error
where did I go wrong
#include <SoftwareSerial.h>
SoftwareSerial bluetooth(10, 11); // RX, TX
int relayD = 2;
int relayP = 3;
int relayT = 4;
int relayG = 5;
int BluetoothData;
void setup()
{
bluetooth.begin(9600);
pinMode(relayD,OUTPUT);
pinMode(relayP,OUTPUT);
pinMode(relayT,OUTPUT);
pinMode(relayG,OUTPUT);
}
void loop()
{
if (bluetooth.available())
{
BluetoothData=bluetooth.read();
if(BluetoothData=='d')
{
digitalWrite(relayD,1);
delay(1000);
digitalWrite(relayD,0);
}
if(BluetoothData=='p')
{
digitalWrite(relayP,1);
delay(1000);
digitalWrite(relayP,0);
}
if(BluetoothData=='t')
{
digitalWrite(relayT,1);
delay(1000);
digitalWrite(relayT,0);
}
if(BluetoothData=='g')
{
digitalWrite(relayG,1);
delay(1000);
digitalWrite(relayG,0);
}
{
digitalWrite(relayD,0);
digitalWrite(relayP,0);
digitalWrite(relayT,0);
digitalWrite(relayG,0);
}
}
delay(100);
}
tbird_app2.ino (1.14 KB)