CPP 154
Hc-05 led arduino uno Guest on 3rd February 2024 07:51:06 AM
  1. #define led 7
  2. int a = 0;
  3.  
  4. void setup() {
  5.   pinMode(led, OUTPUT);
  6.   Serial.begin(9600);
  7. }
  8.  
  9. void loop() {
  10.   if(Serial.available() != 0){
  11.     a= Serial.read();
  12.  }
  13.  
  14.  if (a== '0') {
  15.   digitalWrite(ledPin, LOW);
  16.  }
  17.  else if (a== '1') {
  18.   digitalWrite(ledPin, HIGH);
  19.  }
  20. }

Hightechrobo bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.