Grove - Introduction to Chainable LED

Grove - Introduction to Chainable LED © GPL3+

This project shows how to connect a chainable LED to Grove.

  • 1,023 views
  • 0 comments
  • 3 respects

Components and supplies

Apps and online services

About this project

Introduction

I would like to share my first steps with the Grove 'plug & play' components. This is primarily a chainable LED. The sketch shows the full color spectrum. The LED itself offers an extension to connect additional LEDs from the manufacturer. Once the Grove Base Shield is plugged onto the Arduino Uno R3, the Grove's universal cable can be used to connect the LEDs to port D7.

Code

I use the Arduino WebIDE and have the code of Seeedstudio available in the facility for copy & paste. A Libary is needed: 2 additional tabs were created, namely ChainableLED.cpp and ChainableLED.h.

Summary

This short introduction reflects on the available original example of Seeedstudio. Further examples with the representation of light changes red / blue and changes in light intensity are available in the Libary.

Further examples with a introduction in components from Grove Starter Kit can be found here:

More projects under my account.

Code

Chainable LED C/C++
Example Code from Seeedstudio
/* 
 * Example of using the ChainableRGB library for controlling a Grove RGB.
 * This code cycles through all the colors in an uniform way. This is accomplished using a HSB color space. 
 */


#include "ChainableLED.h"

#define NUM_LEDS  5

ChainableLED leds(7, 8, NUM_LEDS);

void setup()
{
  leds.init();
}

float hue = 0.0;
boolean up = true;

void loop()
{
  for (byte i=0; i<NUM_LEDS; i++)
    leds.setColorHSB(i, hue, 1.0, 0.5);
    
  delay(50);
    
  if (up)
    hue+= 0.025;
  else
    hue-= 0.025;
    
  if (hue>=1.0 && up)
    up = false;
  else if (hue<=0.0 && !up)
    up = true;
}

Comments

Similar projects you might like

LED Emergency Lights using WS2812 RGB LED Module

Project tutorial by bigboystoys13

  • 10,624 views
  • 7 comments
  • 27 respects

Bluetooth control led with lcd led status display real time.

Project tutorial by Youssef Sabaa

  • 17,290 views
  • 4 comments
  • 34 respects

Control LED Using Your Voice Command

by Team IoTBoys

  • 13,242 views
  • 3 comments
  • 21 respects

Controlling LED Using Blynk

by Patel Darshil

  • 5,640 views
  • 0 comments
  • 14 respects

Multicolor Knight Rider with RGB PL9823 LED + Arduino UNO

Project tutorial by Giovanni Gentile

  • 4,414 views
  • 0 comments
  • 11 respects
Add projectSign up / Login