User Tools

Site Tools


de_twi_status_led_lcd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
de_twi_status_led_lcd [2013/05/11 14:18]
admin
de_twi_status_led_lcd [2013/05/11 14:24]
admin
Line 27: Line 27:
 {{:​de_twi_status_led_lcd_1_0_0:​i2c_leds.png?​300|}}\\ {{:​de_twi_status_led_lcd_1_0_0:​i2c_leds.png?​300|}}\\
 ==== Source example ==== ==== Source example ====
 +<file ino LCD_Keypad_DL_V1_0_0.ino>​
 +/*
 +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 <​Wire.h>​
 +
 +#include <​DpI2CIOPCF8574.h>​
 +
 +// 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);​
 +  }
 +}
 +</​file>​
 +\\
 +DpI2CIOPCF8574 library you may found [[arduino_code|here]]. \\
  
de_twi_status_led_lcd.txt ยท Last modified: 2016/09/01 14:17 (external edit)