This program uses a graph plot to display the value of a voltage being applied to pin A1. We scale the input voltage to be between 0 and 100.
Program
---
Simple Plot Program
This program uses a graph plot to display the value
of a voltage being applied to pin A1.
We scale the input voltage to be between 0 and 100.
---
prog_vars =
d/Xpos 0
prog_vars.
prog_start =
pclear
print "Program Start"
-- show the title
ptl 10 10 ^ts=26^ "Simple Plot Program"
-- Add a quit button
pb 500 10 ^n=Quit^p=exitprog^
-- Setup port pin A1 to be an anaog input and scale between 0 to 100.
gvr a1 0 100
prog_start.
prog_loop =
-- main program loop
-- Plot the current value
plot 0 50 ^id=V1^n=Voltage^xn=Time^t1n=Volts^xp=/Xpos^v1=/a1^
inc /Xpos
d250
prog_loop.
prog_stop =
ptl 350 0 ^ts=34^ "Bye"
prog_stop.