Bubble display example using NXP PCAL9555A GPIO expander
Fork of PCAL9555_Hello by
main.cpp@0:26310705044b, 2015-03-07 (annotated)
- 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?
User | Revision | Line number | New 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 | } |