Saturday, 1 October 2022

Arduino Serial Monitotr

https://maker.pro/arduino/projects/led-controlling-using-serial-monitor-arduino

 

 void setup() {
  pinMode(13, OUTPUT);
  Serial.begin(9600);
}
void loop() {
  if (Serial.available() > 0) {
    int state = Serial.read();
    if (state == 53) {
      digitalWrite(13, HIGH);
      Serial.println("LED ON");
    }
    if (state == 54 ) {
      digitalWrite(13, LOW);
      Serial.println("LED OFF");
    }
  }
  delay(50);
}

 

 

 

https://www.youtube.com/watch?v=g0pSfyXOXj8&list=PLA567CE235D39FA84&index=6

No comments:

Post a Comment