upload - Arduino Bluetooth connection gives me uploading error -


İt's simple basic thing in have arduino connected hc-06 bluetooth. point control switch on/off led pin phone. here's code :

int ledpin = 13; int state = 0; int flag = 0;   void setup() {  pinmode(ledpin, output);  digitalwrite(ledpin, low);  serial.begin(9600);  }  void loop() {   if(serial.available() >0) {    state = serial.read();    flag = 0;  }    if(state == '0') {    digitalwrite(ledpin, low);     serial.println("led: off");      flag = 1;    }  }   else if (state == '1') {    serial.println("led: on");    flag = 1;   } 

} don't think might have relevance. whenever try upload code gives me following error:

avrdude stk500_recv() programmer not responding avrdude stk500_getsync() attempt # of 10 not in sync resp=0x00 

any idea why , how might solve it.
thnx in advance!
douglas

i guess there conflict between usb/serial , hc06/serial.

you can solve issue using software serial library , connect hc06 other pins. can find example here on how use library.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -