0
votes

I am doing a sample hello world on arduino uno. here is my sample code.

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.println('Hello world');
}

This is giving me weird output on the serial monitor (with 9600 BR). I get a continuous output of the following:

27748
27748
27748

Why is that?

2

2 Answers

5
votes

Try changing: Serial.println('Hello world'); to Serial.println("Hello world"); I haven't played around with my Arduino in a few months, but I think you need double quotes and not single quotes for strings.

0
votes

I don't know in others but in arduino uno, Serial.println doesn't work with strings, you need to use Serial.write

https://www.arduino.cc/en/Serial/Write