Board: Arduino UNO
Arduino IDE Version: 2.0.0
failing specific of your problem, maybe something like this is what you're after:
// the setup routine runs once when you press reset:
void setup() {
// initialize Serial port for connection to Serial Monitor(PC).
Serial.begin(115200);
// initialize the digital pin as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
char c;
//check if there is any serial data. (type into serial monitor)
if (Serial.available()) {
c = Serial.read();
}
//check if received character == 'a' and blink built-in LED
if (c == 'a') {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
}
hope that helps....
Thank you sir but I don't know how to type into serial monitor
How is your PC a keyboard connected to the Arduino ??
LOOOLLLLLL!!!!
did try doing an internet search then!
Using USB cable type A/B, that is the only connection
You mean you connected your keyboard directly to the arduino?
Which arduino by the way ?
1. Upload the sketch of post #2 into UNO.
2. At the right-up corner of the IDE, there is a icon which when clicked the following Serial Monitor (Fig-1) appears on the desktop of PC.
Figure-1:
(1) Set Baud Rate at 115200.
(2) Choose No line ending option in the Line ending tab
(3) Bring the cursor on the InputBox of the Serial Monitor.
(4) Enter the character a from the Keyboard of your PC and then click on the Send Button of the Serial Monitor.
(5) Check that the L (Built-in LED of UNO) has blinked for once.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.