How to use the RGB onboard of the Arduino Primo Core

Description

In this example is shown how to use the RGB onboard of  Arduino Primo Core.

Hardware

Circuit

primoCore.jpg

It doesn’t need any circuit but it need an Arduino Primo or an external programmer only  for uploading the sketch.
For more information, about how to upload a sketch, visit the Getting Started.

Code

This simple sketch turns on the Red, Green and Blue Led for one seconds.
Upload the below code.

Warning:
Use the Arduino IDE 1.8.x and check that you have already downloaded the latest platform of Arduino NRF52 from the Board Manager.

 
/* This sketch tests the RGB onboard of Arduino Primo Core */

void setup()
{
pinMode(RED_LED, OUTPUT);
pinMode(GREEN_LED, OUTPUT);
pinMode(BLUE_LED, OUTPUT);
}

void loop()
{

 digitalWrite(RED_LED,HIGH);//red
 digitalWrite(GREEN_LED,LOW);
 digitalWrite(BLUE_LED,LOW);
 delay(1000);

 digitalWrite(GREEN_LED,HIGH);//green
 digitalWrite(RED_LED,LOW);
 digitalWrite(BLUE_LED,LOW);
 delay(1000);

 digitalWrite(BLUE_LED,HIGH); //blue
 digitalWrite(RED_LED,LOW);
 digitalWrite(GREEN_LED,LOW);
 delay(1000);
}

Output

Look the sketch that runs on Arduino Primo Core.

Red Led:

red.jpg

Green Led:

green.jpg

Blue Led:

blue.jpg