Go Down

Topic: Serial problem (Read 591 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy