Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

arduino bleutooth module hc-05 with led

char Incoming_value = 0;
void setup() {
  
Serial.begin(9600); //the bluetooth standard port of the hc-05
pinMode(13,OUTPUT);
}

void loop() {
  if (Serial.available() > 0)  
    {
      Incoming_value = Serial.read();
      Serial.print(Incoming_value);
      Serial.print("/n");
      if (Incoming_value == '1') //if you send 0 to the HC-05, LED will be off
        digitalWrite(13,HIGH);
      else if(Incoming_value == '0')//if you send 0 to the HC-05, LED wil be on
        digitalWrite(13,LOW);
    }
}
 
PREVIOUS NEXT
Tagged: #arduino #bleutooth #module #led
ADD COMMENT
Topic
Name
2+2 =