PropellerIDE PropBOE Voltage program
Have not made a code contribution in a while, so this is Propeller BOE Voltage Meter.spin setup for the PropellerIDE. I started with Simple ADC test.spin, that code is commented out and ended up with a version of voltage.spin. I am also thinking of making a conversion of this to C, but the lib would contain mostly commands that you would call to use the ADC aspect of the Propeller BOE.
For this particular program, I just have a wire connection between ADC(3) and the 5V socket, I do not have one of those devices to change the voltage stream, so all I really see is 5V. Now that the program works I will hook this up to an external power source, maybe like my window sill solar panel, and check and see if the program really works as expected.
I am running PropellerIDE on my Windows 7 box, and I do not have a problem with the text display, not sure what all the complaints were about in the other thread. The only thing that I noticed was when you hit return at the end of text line, it sometimes carries some text with it to the new line, not sure if this is a feature of some sort.
Ray
For this particular program, I just have a wire connection between ADC(3) and the 5V socket, I do not have one of those devices to change the voltage stream, so all I really see is 5V. Now that the program works I will hook this up to an external power source, maybe like my window sill solar panel, and check and see if the program really works as expected.
I am running PropellerIDE on my Windows 7 box, and I do not have a problem with the text display, not sure what all the complaints were about in the other thread. The only thing that I noticed was when you hit return at the end of text line, it sometimes carries some text with it to the new line, not sure if this is a feature of some sort.
Ray
''****************************************************************************
'' Voltage.spin
''CON
'' _clkmode = XTAL1 + PLL16X
'' _clkfreq = 80_000_000
OBJ
ser : "Parallax Serial Terminal"
system : "Propeller Board of Education"
''adc : "PropBOE ADC"
volts : "PropBOE Voltmeter"
time : "Timing"
VAR
'' long ad
PUB Start
system.Clock(80_000_000) '' Set system clock to 80 MHz
ser.Start(115200) '' Setup serial terminal for debug
repeat
'' ad := adc.In(3)
Display
time.Pause(250)
PUB Display
ser.Home '' Cursor to Home position
'' ser.Str(String("ad= "))
ser.Str(volts.FloatStr(3))
'' ser.Dec(ad)
ser.ClearEnd '' Clear text to end of line

Comments
Ray