Just a simple voltage meter at the moment
will display upto about (40.9V) lol ,seems acurate to about 0.1v. upto 20v
the highest voltage is the most inaccurate (42.0v)displayed is actually 42.2 volts.
Will look at improving accuracy later maybe in software
or add a adjustable reistor but voltages upto 20 v are quite accurate.
might look for a 10k resistor thats slightly different in value lol.
will display upto about (40.9V) lol ,seems acurate to about 0.1v. upto 20v
the highest voltage is the most inaccurate (42.0v)displayed is actually 42.2 volts.
Will look at improving accuracy later maybe in software
or add a adjustable reistor but voltages upto 20 v are quite accurate.
might look for a 10k resistor thats slightly different in value lol.
Code:
' -- -- -- -- -- --
' B0-A | | | | | | |
' B1-B Picake 20x2 ver C.0
' B2-C | | | | | | |
' B3-D -- -- -- -- -- -- MarkS
' B4-E | | | | |
' B5-F
' B6-G | | | | |
' B7-dp -- -- -- -- o -- --
'
'Display 1 2 3 4
'Common anode C.3 C.2 C.1 c.0
SETFREQ M16
eeprom 0,(192,249,164,176,153,146,130,248,128,144,255) 'Display (0,1,2,3,4,5,6,7,8,9,blank)
SYMBOL display1 = C.3
SYMBOL display2 = C.2
SYMBOL display3 = C.1
SYMBOL display4 = C.0
SYMBOL volts = W10
SYMBOL number = B11
SYMBOL response = B12
main:
let dirsb = %11111111
let dirsc = %00111111
voltage:
Readadc10 c.7,volts
volts = volts * 5 ' Input (5.0v)= 500 and (50.0v)=5000
display:
for response =1 to 50
number = 10 : IF volts < 1000 THEN dig1 'Display1 Zero blanking
LET number = volts DIG 3
Dig1: READ number,pinsb : LOW display1 : PAUSE 1 : HIGH display1 '5
LET number = volts DIG 2
Dig2: READ number,pinsb : pinsb=pinsb-128 : LOW display2 : PAUSE 1 : HIGH display2 '0.
LET number = volts DIG 1
Dig3: READ number,pinsb : LOW display3 : PAUSE 1 : HIGH display3 '0
Dig4: pinsb = 157 : LOW display4 : PAUSE 1 : HIGH display4 'v
next response
goto voltage
Attachments
-
256.9 KB Views: 355
Last edited: