konstantinos damaskos / Mbed OS pcf8574-IO_expander

Dependencies:   PCF8574

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 
00002 #include "mbed.h"
00003 #include "pcf8574.h"
00004 
00005 I2C _i2c(D14, D15);// (sda,scl)
00006 PCF8574 pcf0(&_i2c,0x00,PCF8574_TYPE);
00007 
00008 int main()
00009 {
00010     pcf0.WriteByte(0b00010100);
00011     thread_sleep_for(5000);
00012     pcf0.WriteByte(0b00000100);
00013     thread_sleep_for(5000);
00014     pcf0.WriteByte(0b00010000);
00015     thread_sleep_for(5000);
00016     pcf0.WriteByte(0b00010100);
00017 
00018     while (true) {
00019 
00020     }
00021 }