I keep getting "error compiling for board" and I don't know why .
hi i'm learning how interface arduino , android phone application arduino using hc - 06 bluetooth device. code below isn't mine, modified little bit error compiling when i'm trying verify code, meaning isn't board problem. seems right me problem serial library. can please?
code: [select]
#include <softwareserial.h>
#include <spi.h>
#include <wire.h>
#include <adafruit_ssd1306.h>
#define oled_reset 4
adafruit_ssd1306 display(oled_reset);
softwareserial bt(10, 11); //tx, rx respetively
string state;// string store incoming message bluetooth
void setup() {
bt.begin(9600);// bluetooth serial communication happen on pin 10 , 11
serial.begin(9600); // serial communication check data on serial monitor
display.begin(ssd1306_switchcapvcc, 0x3c);
display.cleardisplay();
pinmode(13, output); // led connected 13th pin
}
void loop() {
while (bt.available()){ //check if there available byte read
delay(10); //delay added make thing stable
char c = bt.read(); //conduct serial read
state += c; //build string- either "on" or "off"
}
if (state.length() > 0) {
serial.println(state);
if(state == "turn on")
{
digitalwrite(13, high);
display.cleardisplay();
display.settextsize(3);
display.settextcolor(white);
display.setcursor(0,0);
display,println("led on!");
display.display();
}
else if(state == "turn off")
{
digitalwrite(13, low);
display.cleardisplay();
display.settextsize(3);
display.settextcolor(white);
display.setcursor(0,0);
display,println("led off!");
display.display();
}
state ="";}} //reset variable
</softwareserial.h>
please copy , paste entire error message.
it if tell arduino using.
it if tell arduino using.
Arduino Forum > Using Arduino > Programming Questions > I keep getting "error compiling for board" and I don't know why .
arduino
Comments
Post a Comment