/*Output Expander Module This program converts a serial into a parallel output with 8 output ports per board. Each output ports has LED state indicators. +3.3V or +5V of the microcontroller may be used. This module is usually used with an input expander module. JP2 pin assignments: Din on digital pin 8 Str on digital pin 9 Clk on digital pin 10 VDD on +5V Codes by: eGizmo Mechatronix Central Manila, Philippines April 3, 2013 */ // Constants const int DataIN = 8; const int StrIN = 9; const int ClkIN = 10; void setup() { pinMode(DataIN, OUTPUT); // Pin 8 as output pinMode(ClkIN, OUTPUT); // Pin 9 as output pinMode(StrIN, OUTPUT); // Pin 10 as output } void loop() { for(int i = 0; i<=256; i++) { shiftOut(i); // Set cycle for strobe in digitalWrite(StrIN, HIGH); digitalWrite(StrIN,LOW); delay(500); } } void shiftOut(byte DataOUT) // Sets a byte called DataOUT { boolean state; // Sets the cycle for data in and clock in digitalWrite(DataIN, LOW); digitalWrite(ClkIN, LOW); for (int i=0; i<=7; i++) // This is set for 8bit binary. { digitalWrite(ClkIN, LOW); if (DataOUT&(1<