Arduino bluetooth control
THIS CODE IS Arduino bluetooth
char val;
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop() {
if(Serial.available()){
val = Serial.read();
Serial.println(val);
}
if(val == '1') {
digitalWrite(13,HIGH);
}
else if (val == '2'){
digitalWrite(13,LOW);
}
delay(1000);
}
No comments:
Post a Comment