Simple Bs2 code to plot a Variable 0-5vdc
riverdan
Posts: 21
I thank what I need to get started in the right direction is a Simple Bs2 code to plot a Variable 0-5vdc like a temperature plot in analog. I would like it to plot up when the volts go up and down when the volts go down. I guess the input would be on P0? The code I came up with it does this, it gets to 1.9, or the like, and levels off, another code i used its goes down to 0vdc. I would like the input to be direct to Bs2, not an A/D if this is OK. If not I have a lot of·ADC ICs. I would like to do this in the History Plot.
·
Thanks a Bunch
·
·
Thanks a Bunch
·
Comments
1) StampPlot Pro (near bottom of page) - www.parallax.com/html_pages/downloads/software/software_basic_stamp.asp
2) Using the Stamp for ADC - www.emesystems.com/BS2index.htm#misc - In particular, look at use of RCTIME command for measuring voltages.
This is just what I was looking for a quick easy and direct input to basic stamp2 on P0. By using the voltage spilter and a cap the pin volts are in mvolts. I did not know that I could not analog direct to stamp2. I can plot in plotpro or plotlite. Now I just need to figure out values of the cap and res. By using RCtime I will playing with the following code.
Thanks Again
Riverdan
' {$STAMP BS2}
X VAR Word
DIRS =$ffff
loop:
PAUSE 1000
RCTIME 1,0,X ' get reading
LOW 1 ' discharge capacitor
DEBUG DEC X,CR
GOTO LOOP