Nucleo F334R8 RGB led example

This is  a basic example with the ST Nucleo F334R8 board, this uses the mbed online compiler.

In this example we flash the red, green and blue colours of an RGB led . Our RGB LED was a common anode type, so a low output switches the LED on and a high output switches the LED off.



[codesyntax lang=”cpp”]

#include "mbed.h"
DigitalOut red(D5);
DigitalOut blue(D8);
DigitalOut green(D9);
int main() 
        red = 0; //red on
        wait(1.0); // 1 sec
        red = 1; //red off
        green = 0; //green on
        wait(1.0); // 1 sec
        green = 1; //green off
        blue = 0; //blue on
        wait(1.0); // 1 sec
        blue = 1; // blue off


Waveshare STM32 Board Nucleo NUCLEO-F334R8 STM32F334R8 STM32 Development Board Integrate ST-LINK/V2-1 Debugger/Programmer Support Arduino

This div height required for enabling the sticky sidebar
Ad Clicks : Ad Views : Ad Clicks : Ad Views :