1 Answer 1
You haven't "started" the serial interface. Before you use the serial you need to tell it to initialize the hardware and how fast you want to communicate.
You need to add, for instance,
Serial.begin(9600);
to your setup()
function before you do your Serial.print()
.
answered Mar 25, 2016 at 12:05
-
What does the command do exactly? Why 9600?Gabriele Giordano– Gabriele Giordano2016年03月25日 12:06:48 +00:00Commented Mar 25, 2016 at 12:06
-
Still can't see nothing in the serialGabriele Giordano– Gabriele Giordano2016年03月25日 12:07:22 +00:00Commented Mar 25, 2016 at 12:07
-
It makes it work. At the moment you have sat in your car and and are pressing the accelerator - but you forgot to start the engine. You need to make sure that you are communicating at the same speed as you have specified in the begin() function call. Also you may see more if you change your
print
to aprintln
and place it in loop instead of setup so it sends it over and over again.Majenko– Majenko2016年03月25日 12:08:43 +00:00Commented Mar 25, 2016 at 12:08 -
still nothing in the serial monitorGabriele Giordano– Gabriele Giordano2016年03月25日 12:10:45 +00:00Commented Mar 25, 2016 at 12:10
-
Are you sure you are programming the board? Try using the Blink example to make sure you are actually programming it. Then try the AnalogInOutSerial example.Majenko– Majenko2016年03月25日 12:12:31 +00:00Commented Mar 25, 2016 at 12:12