Hello world program for PCAL955x component library. This demonstrates standard usage of this library.

Dependencies:   PCAL955x mbed

Refer to library page for details.

Committer:
nxp_ip
Date:
Sat Mar 07 13:05:21 2015 +0000
Revision:
0:26310705044b
Child:
1:15df36975a85
Initial version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nxp_ip 0:26310705044b 1 #include "mbed.h"
nxp_ip 0:26310705044b 2 #include "PCAL9555.h"
nxp_ip 0:26310705044b 3
nxp_ip 0:26310705044b 4 PCAL9555 gpio( p28, p27, 0x40 );
nxp_ip 0:26310705044b 5
nxp_ip 0:26310705044b 6 int main()
nxp_ip 0:26310705044b 7 {
nxp_ip 0:26310705044b 8 gpio.configure( 0xFFFF ); // Set all pins: input
nxp_ip 0:26310705044b 9 printf( " 0x%04X\r\n", (int)gpio );// Print pins state
nxp_ip 0:26310705044b 10
nxp_ip 0:26310705044b 11 gpio.configure( 0x0000 ); // Set all pins: output
nxp_ip 0:26310705044b 12
nxp_ip 0:26310705044b 13 int count = 0;
nxp_ip 0:26310705044b 14
nxp_ip 0:26310705044b 15 while(1) {
nxp_ip 0:26310705044b 16 gpio.write( count++ );
nxp_ip 0:26310705044b 17 }
nxp_ip 0:26310705044b 18 }