Analog Input Graph (3.0 branch only)
memclear
graphics 300,300 timer 1000, [doit] [top] x = 0 gcls text 10,100,"Anolog in",180 + 90 text 100, 250, "Time (1 second)",0 wait [doit] aOLD = a a = io(ai) / 4 xOLD = x x = x + 10 line xOLD,aOLD,x,a,5 if x > 300 then goto [top] wait |
This is a simple analog input graph.
It checks the analog input pin on the esp8266 every second and displays the result as a graph. Notice how when the graph reaches the right hand side it clears the graph area and starts again from the left. |