blinky example for NXP rapid IoT prototyping kit https://www.nxp.com/design/designs/nxp-rapid-iot-prototyping-kit:IOT-PROTOTYPING Read more at https://www.hackster.io/marcomerli/riotwear-mbed-2b2011

This is the blinky example for NXP rapid IoT prototyping kit, based on the hexiwear mbed platform. https://www.nxp.com/design/designs/nxp-rapid-iot-prototyping-kit:IOT-PROTOTYPING

main.cpp

Committer:
batman52
Date:
2019-11-23
Revision:
79:0431b9fd3dc0
Parent:
78:ddf5cff958fa

File content as of revision 79:0431b9fd3dc0:

#include "mbed.h"

DigitalOut rgb_red(LED_RED, 1);       //     LED1 = LED_RED,  1 --> OFF, 0 --> ON
DigitalOut rgb_blue(LED_BLUE, 1);     //     LED3 = LED_BLUE, 1 --> OFF, 0 --> ON
DigitalOut rgb_green(PTE7,1);         //                      1 --> OFF, 0 --> ON

void rgb_sel(int8_t idx) {

switch(idx) {
                case 0:
                    rgb_red = 0; rgb_blue=1; rgb_green = 1;
                    break;
                case 1:
                    rgb_red = 1; rgb_blue=0; rgb_green = 1;
                    break;
                case 2:
                    rgb_red = 1; rgb_blue=1; rgb_green = 0;
                    break;
            }
    
}

// main() runs in its own thread in the OS
int main() {
    int idx;
    while (true) {
        for(idx=0;idx<3;idx++) {
            rgb_sel(idx);
            wait(0.5);
        }        
    }
}