I have my environment configured with the imp ready to read inputs. I have three inputs that I would like to read and have the following logic in my device firmware
=======
function onechanged() {
local loopState = hardware.pin1.read();
server.log("pin1 read");
if (loopState == 0) {
// do something
} else {
// do something else
}
}
function twochanged() {
local loopState = hardware.pin2.read();
server.log("pin2 read");
if (loopState == 0) {
// do something
} else {
// do something else
}
}
function fivechanged() {
local loopState = hardware.pin5.read();
server.log("pin5 read");
if (loopState == 0) {
// do something
} else {
// do something else
}
}
hardware.pin1.configure(DIGITAL_IN, onechanged);
hardware.pin2.configure(DIGITAL_IN, twochanged);
hardware.pin5.configure(DIGITAL_IN, fivechanged);
========
I am trying to figure out how to I test my input triggers? Can I just connect a 1.5V battery’s two leads to the input or any quick way to test the trigger to see if my callback is being correctly called back?
Did not see any thing on the forum hence this question. Anybody has any insights with this, please provide some pointers.
Thx