I have been working on a UPS tester using a CS-50A Hall-Effect Current Sensor from panucatt.com. The sensor is working well and I can compute observed current measurements is a spreadsheet. However the math is throwing me.
This works in a spreadsheet: current = ((rawCurrent*(5/1024))-(5/2))/(4/100)
How can I compute this on a PICAXE?
(BTW(I love (parentheses)!))
This works in a spreadsheet: current = ((rawCurrent*(5/1024))-(5/2))/(4/100)
How can I compute this on a PICAXE?
Code:
#PICAXE08M2
symbol rawCur = w0
symbol rawVolt = w1
symbol current = w3
symbol voltage = w4
symbol logger = C.1
symbol LCDpin = C.0
symbol cSense = C.2
symbol vSense = C.4
start:
pause 500
low LCDpin
high logger
pause 100
serout logger,t2400,("time", 9, "rawCur", 9, "rawVolt", 13,10)
main:
readadc10 cSense, rawCur
readadc10 vSense, rawVolt
' current = ((rawCur*(5/1024))-(5/2))/(4/100)
serout LCDpin, n2400,(12, "time:",#time)
serout LCDpin, n2400,(16,80, "c:",#rawCur," v:", #rawVolt)
serout logger,t2400,(#time, 9, #rawCur, 9, #rawVolt, 13,10)
pause 5000
goto main