Hello world program for PCAL955x component library. This demonstrates standard usage of this library.
Refer to library page for details.
Diff: main.cpp
- Revision:
- 0:26310705044b
- Child:
- 1:15df36975a85
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Mar 07 13:05:21 2015 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" +#include "PCAL9555.h" + +PCAL9555 gpio( p28, p27, 0x40 ); + +int main() +{ + gpio.configure( 0xFFFF ); // Set all pins: input + printf( " 0x%04X\r\n", (int)gpio );// Print pins state + + gpio.configure( 0x0000 ); // Set all pins: output + + int count = 0; + + while(1) { + gpio.write( count++ ); + } +}