Bubble display example using NXP PCAL9555A GPIO expander
Fork of PCAL9555_Hello by
Diff: main.cpp
- Revision:
- 3:f74f521b2e46
- Parent:
- 2:ae0b95d42407
- Child:
- 4:0f3b252fb13f
diff -r ae0b95d42407 -r f74f521b2e46 main.cpp --- a/main.cpp Sat Feb 18 12:54:01 2017 +0000 +++ b/main.cpp Sat Feb 18 15:37:34 2017 +0000 @@ -1,3 +1,5 @@ +#pragma Ospace + #include "mbed.h" #if 1 @@ -8,7 +10,7 @@ #if defined(TARGET_LPC81X) //PCAL9555 gpio_exp(P0_10, P0_11); -I2C gpio_exp(P0_10, P0_11); +I2C gpio_exp(dp4, dp3); #else //PCAL9555 gpio_exp(SDA, SCL); I2C gpio_exp(SDA, SCL); @@ -17,7 +19,7 @@ //Serial pc(USBTX, USBRX); Ticker tick; -static int _seg = 0; +static int _seg; static int _chrs[4]; const char dispTabl[] = { @@ -57,8 +59,8 @@ port_0 = 0xe0; _seg = 0; break; + } - } #ifdef USE_LIB gpio_exp.write( (_data << 8) | port_0 ); #else @@ -81,8 +83,10 @@ int main() { + _seg = 0; + #ifdef USE_LIB - gpio_exp.configure( 0x0000 ); // Set all pins: output + gpio_exp.configure(0x0000); // Set all pins: output #else char buf[3]; buf[0] = 0x06; // CONFIG