Confusion printing on serial monitor?

My tinkercad code is given below

int count;//number of led blinks

void setup()
{
  pinMode(13,OUTPUT);
  Serial.begin(9600);
  Serial.println("How many times do you want red led to blink?");
  while (Serial.available() ==0) {}
  count = Serial.parseInt();
  Serial.println('Original desired final target for count');
  Serial.println(count);
}
}

void loop()
{
  for (int i=0; i<count; i++)
  {
    digitalWrite(13,HIGH);
    delay(500);
    digitalWrite(13, LOW);
    delay(500);
  }
  delay(5000);
}

In void setup() i also want to show the original final desired count target and i have also attached a snapshot to show my issue but i am not getting on output the string''Original desired final target for count"

Looks like you're using single quotes in that println statement. Try using double quotes and see what happens.

Your code has mismatched braces ( { } )

If you have compiler warnings turned on you will see this message...

/var/folders/4z/3g9th3gs4cng3b803dg5bhw40000gn/T/arduino_modified_sketch_385409/Blink.ino:10:18: warning: character constant too long for its type
   Serial.println('Original desired final target for count');
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It's complaining because you used single quotes (') around the string rather the double quotes (")

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.