Go Down

Topic: Serial problem (Read 540 times) previous topic - next topic

Barbo

Hi,
i am a newbie. I write this program but don't work. Why?

void setup() {
 Serial.begin(9600);
 pinMode(9, OUTPUT);
}

void loop() {
 digitalWrite(9,HIGH);
 Serial.println("ON");
 delay(500);
 
 digitalWrite(9,LOW);
 Serial.println("OFF");
 delay(500);
}

The led blink but in the console ( is the console down to the ide? ) don't show anything...

In the board i have just a led and a 330 resistor.


if i try that code the led blink:

void setup() {
 pinMode(9, OUTPUT);
}

void loop() {
 digitalWrite(9,HIGH);
 delay(500);
 digitalWrite(9,LOW);
 delay(500);
}

so there isn't a led problem.

Groove

Have you opened the serial monitor on the IDE?
Per Arduino ad Astra

Go Up