What am I doing wrong?
here's my code:
Code: Select all
local resi
local poslimit = 1515
local neglimit = 1485
reset()
--Set the measure function to 2-wire resistance
dmm.measure.func = dmm.FUNC_RESISTANCE
--Set the measure function to 4-wire resistance
--dmm.measure.func = dmm.FUNC_4W_RESISTANCE
-- Set the number of power line cycles 1 PLC
dmm.measure.nplc = 1
-- Immediately update autozero reference measurements and then disable the autozero function
dmm.measure.autozero.once()
-- Enable offset compensation for more accurate resistance reading
--dmm.measure.offsetcompensation.enable = dmm.ON
display.changescreen(display.SCREEN_USER_SWIPE)
while true do
display.settext(display.TEXT1, "FAIL")
resi = dmm.measure.read()
if (resi > neglimit and resi < poslimit) then
display.settext(display.TEXT1, "PASS")
--beeper.beep(0.05, 2400)
else
display.settext(display.TEXT1, "FAIL")
delay(0.1)
end
end