I can understand active low inputs and outputs. Do you teach the kids to create a constant at the start of the program for IO_TRUE = 0 and IO_FALSE = 1 then use these in your Boolean statements. I know the syntax is wrong with-out the main method and what not. I’m not real hi speed with C Code but you get the point.
#define IO_TRUE 0
#define IO_FALSE 1
#define TRUE 1
#define FALSE 0
while (TRUE){
switch = getdigital(1);
if (switch == IO_TRUE){ // switch is pressed input pulled LOW
// Do something
setDigitalOut(2,IO_TRUE); //Turn on Output 2
}else{
setDigitalOut(2,IO_FALSE); //Turn off Output 2
}
}