Documentation **[[Documentation|Home]]** ====== BASIC INFORMATION ====== Name: **I2C Digital IO Board**\\ Type: **Adpater Board**\\ Version: **1.0.0**\\ Author: **Dubravko Penezic**\\ Copyright: **Creative Commons BY-NC-SA v 3.0**\\ Implemented function: * **PCF8574(A) 8 input ports with or without pull-down resistor** * **PCF8574(A) 8 output ports with transistor controlled ground (GND)** * **2x RGB LED 5050 and 2 LED 0805 possible** * **Input/output pads available** * **Selective input or output mode for all 8 pins** * **connectivity for [[lcd_kyb|LCD & KYB V 1.0.0]] with option to put analogue line instead of INT line to connectivity bus** * **selectable I2C address** * **selectable pulling resistors for I2C bus** \\ PCB Top image:\\ {{:de_twi_status_led_lcd_1_0_0:img_1602.png?|}} \\ PCB Bottom image:\\ {{:de_twi_status_led_lcd_1_0_0:img_1600.png?|}} \\ ====== Implementation ====== ==== Schematic ==== {{:de_twi_status_led_lcd_1_0_0:i2c_pcf8574.png?300|}} \\ {{:de_twi_status_led_lcd_1_0_0:i2c_io_selector.png?300|}} \\ {{:de_twi_status_led_lcd_1_0_0:i2c_leds.png?300|}}\\ ==== Source example ==== /* Author: Dubravko Penezic Version: 1.0, 2012 This code is example how to use DpI2CIOPCF8574 library. Source code is provided as is, without any warranty. Distributetd under CC BY v 3.0 http://pcb.daince.net/doku.php?id=arduino_code */ // Library contain Wire.h include, but you need to declare it once again #include #include // set the address to 0x20 - 0x27 for PCF8574 // set the address 0x38 - 0x3F for PCF8574A used on daince I/O Expansion #define boardAddr 0x38 // initialize daince I/O Expansion DpI2CIOPCF8574 io; void setup(void) { Serial.begin(9600); Serial.println("DpI2CIOPCF8574 V 1.0"); Wire.begin(); io.begin(boardAddr); // all pins are output high on begining io.setOutputLow(); } void loop(void) { for(int i = 0; i<8; i++){ io.setOutputStatus(); io.toggleOutputPin(i); delay(2000); } } \\ DpI2CIOPCF8574 library you may found [[arduino_code|here]]. \\