ALL Green But No Go

UKHeliBOB solved my error code, and im not sure how but its gone, But now I have code that loaded

up all green and no errors but no joy, and nothing will print out on the serial monitor either.

here is the code that loads up all green--if anyone sees whats wrong please tell me.

Thank you
int redPin=9;
int numblinks=10;
int redOnTime=500;
int redOffTime=250;
String redMessage="The red led is blinking";

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(redPin , OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
Serial.println(redMessage);

Serial.print("you are on blink #: ");

digitalWrite(redPin, HIGH);

delay(redOnTime);

digitalWrite(redPin, LOW);
delay(redOffTime);

}

Show us a good schematic & image of your circuit.
Posting images:

Is your serial monitor set to 9600?

ALL Green But No Go

What the Hell does that mean?

Please remember to use code tags when posting code

Yes--serial monitor is matched to serial port at 9600 baud

Show us a good schematic & image of your circuit.
Posting images:

All your code does is the following:

  • Display "The red led is blinking", then go to the next line.
  • After that, it loops the following :
  • Display "you are on blink #: The red led is blinking" and blink the led, skip line

That's all : no green whatsoever (I like that word :slight_smile: )

yes I know, but thats my point, nothing is printing to the serial monitor at all

Let’s have another go…

int redPin=9;
 int numblinks=10;
 int redOnTime=500;
 int redOffTime=250;
 
 String redMessage="The red led is blinking";
  
 // -------------------------
 void setup() {
  // put your setup code here, to run once:
     Serial.begin(9600);
     pinMode(redPin , OUTPUT);
 }

 // -------------------------
void loop() {
  // put your main code here, to run repeatedly:
  Serial.println(redMessage);

  Serial.print("you are on blink #: ");

 digitalWrite(redPin, HIGH);
 delay(redOnTime);

 digitalWrite(redPin, LOW);
 delay(redOffTime);
}

Is serial monitor configured at 9600 bps ?

You never use numb links or increment it…

 Serial.print("you are on blink #: ");

– doesn’t actualy tell you anything about numb links.

And while we’re there - a good time to stop using String.

zerotact:
yes I know, but thats my point, nothing is printing to the serial monitor at all

But what the Hell has that got to do with "green"?

zerotact:
yes I know, but thats my point, nothing is printing to the serial monitor at all

Works OK fro me

Sample output

The red led is blinking
you are on blink #: The red led is blinking
you are on blink #: The red led is blinking
you are on blink #: The red led is blinking
you are on blink #: The red led is blinking

It is nonsense but it does print

How about trying this :

int redPin=9;
 int numblinks=1;
 int redOnTime=500;
 int redOffTime=250;
 
 String redMessage="The red led is blinking";
  
 // -------------------------
 void setup() {
  // put your setup code here, to run once:
     Serial.begin(9600);
     pinMode(redPin , OUTPUT);
    Serial.println(redMessage);
 }

 // -------------------------
void loop() {
  // put your main code here, to run repeatedly:

  Serial.print("you are on blink #: ");
  Serial.println(numblinks);

 digitalWrite(redPin, HIGH);
 delay(redOnTime);

 digitalWrite(redPin, LOW);
 delay(redOffTime);
 numblinks++;
}

When you upload the sketch does the IDE say "Done uploading" in the green bar below your sketch? Trying to determine if you are hitting verify instead of upload.

The 9600 baud value has to appear in two places, one in your sketch which we can see and another at the bottom of the serial monitor.

Great, UKHeliBOB--you have it working and it still does not work on my pc, maybe there is

something wrong other than the code. yah, I thought the code would just put in the numbers--

1-2-3-etc, I guess not--no wonder it makes no sense.

Try this

void setup() 
{
	Serial.begin(9600);
	Serial.println("Hello World");
}

void loop() 
{
}

Make sure that the baud rate in the Serial monitor is set to 9600
What do you see printed in the Serial monitor ?

No that does not print either--Damn--whats going on

Time for silly questions

Are you sure that you are uploading the code ? How do you know ?
Are you actually opening the Serial monitor ?
What baud rate is the program set to ? What baud rate is the Serial monitor set to ?

This sketch will only work if your PC has an external green colour.

A can of green spray paint might be the answer.

The RED pc board does not do Green.

The code does print....Confirmed.

How

do 

copy

the 

monitor

display

here???

Click in the display
Ctrl and A on the keyboard to select all of the output
or left click and select part of it using the mouse
Ctrl and C to copy the selected text to the clipboard