Reading inputs

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

On the imp, you’d just connect a wire between 3.3v and the imp pin. However, your board has isolated inputs that need more than 1.5v to trigger them.

A 9v battery would do fine. It needs to be connected the right way round for this to work (respect the +/- symbols on the PCB) though if you connect it the wrong way, these inputs are protected against damage.