Daniel Scarnatto / Mbed 2 deprecated Test2PCF8574

Dependencies:   mbed PCF8574

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "pcf8574.h"
00003 
00004 
00005 
00006 I2C _i2c(D14, D15);// (sda,scl)
00007 
00008 
00009 int main()
00010 {
00011  //Inicializamos 
00012  PCF8574 pcf(&_i2c,0x00,PCF8574_TYPE);
00013  unsigned char dato;
00014  dato = 0x01;
00015  while(1)
00016  {
00017     pcf.WriteByte(dato);
00018     wait(0.5);
00019     if (dato == 0x80) dato = 0x01;
00020     dato = (dato << 1);
00021        
00022  }   
00023     
00024 }