Instructables

Intro to Arduino

Featured

Step 7: Serial monitor

Picture of Serial monitor
cap025.jpg
The serial monitor allows your computer to connect serially with the Arduino. This is important because it takes data that your Arduino is receiving from sensors and other devices and displays it in real-time on your computer. Having this ability is invaluable to debug your code and understand what number values the chip is actually receiving.

For instance, connect center sweep (middle pin) of a potentiometer to A0, and the outer pins, respectively, to 5v and ground. Next upload the sketch shown below:

File --> Examples --> 1.Basics --> AnalogReadSerial

Click the button to engage the serial monitor which looks like a magnifying glass.  You can now see the numbers being read by the analog pin in the serial monitor. When you turn the knob the numbers will increase and decrease. 

The numbers will be between the range of 0 and 1023. The reason for this is that the analog pin is converting a voltage between 0 and 5V to a discreet number.
 
Remove these adsRemove these ads by Signing Up