New to the arduino programming.
I have a MUXSHIELD II sample program for digitalIn and I was wondering how I can make the program cycyle through the IO’s once and Stop?
MuxShieldDigitalIn.ino (1023 Bytes)
New to the arduino programming.
I have a MUXSHIELD II sample program for digitalIn and I was wondering how I can make the program cycyle through the IO’s once and Stop?
MuxShieldDigitalIn.ino (1023 Bytes)
bool beenThereDoneThat = false;
void loop()
{
if(!beenThereDoneThat)
{
Cycle();
beenThereDoneThat = true;
}
}
void Cycle()
{
for (int i=0; i<16; i++)
{
//Digital read on all 16 inputs on IO1, IO2, and IO3
IO1DigitalVals[i] = muxShield.digitalReadMS(1,i);
IO2DigitalVals[i] = muxShield.digitalReadMS(2,i);
IO3DigitalVals[i] = muxShield.digitalReadMS(3,i);
}
//Print IO 1 values for inspection
Serial.print("IO1 analog values: ");
for (int i=0; i<16; i++)
{
Serial.print(IO1DigitalVals[i]);
Serial.print('\t');
}
Serial.println();
}