The Galileo Gen 2 has an onboard LED used in the example cod

The Galileo Gen 2, has an onboard LED used in the example code of Blink. This LED is actually a color LED which can make out different colors !!!

Write an Arduino Code that will change the onboard LED to different colors and different On/Off periods.

Example: Red (1000ms) - Off (100ms) - Green (200ms) - Off (100ms) - Yellow (1000 ms) - Off (100ms).

Solution

Solutiion :- The following code is the Arduino code for that will change the onboard LED to different colors and different On/Off periods.

void blinkLed()
{
   static const int LED_PIN = 13;
   static const unsigned long BLINK_INTERVAL = 500; // duration of each blink phase
   static unsigned long lastBlinkTime = 0;
  
   if(millis() - lastBlinkTime >= BLINK_INTERVAL)
   {
       digitalWrite(LED_PIN, !digitalRead(LED_PIN));
       lastBlinkTime += BLINK_INTERVAL
   }
}

The Galileo Gen 2, has an onboard LED used in the example code of Blink. This LED is actually a color LED which can make out different colors !!! Write an Ardui

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site