mbed and tri color LED

This was an RGB Led breakout example

Red connected to Pin 23
Green connected to pin 22
Blue connected to pin 21

The code example simply cycles through the 3 colours

Code

#include “mbed.h”

DigitalOut redLed(p23);
DigitalOut greenLed(p22);
DigitalOut blueLed(p21);

int main()
{
while(1)
{
redLed = 0;
greenLed = 1;
blueLed = 1;
wait(1);
redLed = 1;
greenLed = 0;
blueLed = 1;
wait(1);
redLed = 1;
greenLed = 1;
blueLed = 0;
wait(1);
}
}

 

Links

mbed – LPC1768 Development Board at Amazon US

mbed – LPC1768 Development Board

Related posts

ST Nucleo F334R8 LCD example

mBed and 16×2 LCD