Hello Friends, in this blog I will share with you how to control Arduino Digital Output with Serial Monitor. I am using One Arduino Uno, One 330 ohm resistor, One LED, 2 connecting cable, and one small Bread board. LED is connected to pin number 12, with the help of resistor 330 ohm. Below is the sketch: // Code by Deepak Sharma // The code is to control one digital output by serial monitor const int LED = 12; void setup() {   // put your setup code here, to run once:   Serial.begin(9600);   pinMode(LED, OUTPUT); } void loop() {   // put your main code here, to run repeatedly:   if (Serial.available()) {     String input = Serial.readStringUntil('\n');     input.trim();     if (input.equalsIgnoreCase("ON")) {       digitalWrite(LED, HIGH);       Serial.println("LED ON");     }     else if (input.equalsIgnoreCase("OFF")) {       digitalWrite(LED, LOW);     ...
 
 
Comments
Post a Comment