Instructables

Graphing values in Arduino, the EASY way!

Featured
Sometimes when you're testing a sensor or debugging a value in an Arduino project, you want to see something other than numbers flying by in the Serial Monitor. However, you want to get the sensor working quickly, and you don't want to take the time to write code to graph it or display it in an intricate way.

Well, we can fix that :)

The trick is very simple. However it graphs it sideways, but hey, it's quick and easy.

Although I usually use this trick with the Serial Port, Sometimes I also use it with an LCD screen
 
Remove these adsRemove these ads by Signing Up

Step 1: Psuedocode!

The basic idea to graphing really quickly is this
print a basic letter, which can be a unit for the graph such as a lowercase L, l;

however, we want to print this letter repeatedly to emulate a graph.
 
Pseudocode:

//Gather Sensor Data;

for(int i = 0; i < (The value you want to graph); i++) {
//print the letter you chose, such as "l"; 
// but print it all on the same line;
}
// now go to the next line in the Serial Monitor;




Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!