InetrfaceProducts NXP / Mbed 2 deprecated PCA9624_Hello

Dependencies:   PCA962x mbed

main.cpp

Committer:
nxp_ip
Date:
2015-02-26
Revision:
0:50ca448b1ffd
Child:
1:e2289f758d62

File content as of revision 0:50ca448b1ffd:

#include "mbed.h"

#include "PCA9624.h"
PCA9624   led_cntlr( p28, p27, 0x3E );    //  SDA, SCL, Slave_address(option)

int main()
{
    while(1) {
        for ( int port = 0; port < led_cntlr.number_of_ports(); port++ ) {
            for ( int i = 1; i <= 100; i++ ) {
                led_cntlr.pwm(  port, (float)i / 100.0 );
                wait( 0.01 );
            }
        }
        led_cntlr.pwm( ALLPORTS, 0.0 );
    }
}