Introduction: Internet Button - RGB LEDs

After posting a lot of tutorials about Particle Core, I taught of creating a series using the internet button and I had also posted a few tutorials on that as well. But what I did not teach was how to control the RGB LED's. So in this instructable I'm going to show you how to control the RGB LED's, to make better projects. So this is a beginners tutorial with the Particle core.

This tutorial is very simple, but it is recommended to try out my precious instructables before jumping into this one.

So lets get started.....

Step 1: Tools and Components

All you need for this tutorial is -

  • Particle Core
  • Internet Button

Note- The particle internet button now comes with a photon so you don't need to buy the particle core.

Step 2: Getting Started

If you have followed my previous instructables you already have set up your core and have it connected to the internet.

If you are here first, then you can check the step two of any of the previous instructables in the series for steps on how to get started.

The steps involve -

  • Creating an account at Particle.io
  • Getting it connected to the internet.
  • Claiming a Core
  • Trying out Tinker
  • Trying out my previous instructables

If you have gone through all of these steps, then you are good to proceed to the next step.

Step 3: Hardware

If you followed my blink tutorial with the internet button you can skip this step.

The Internet button is a shield which holds on to the Core and has 11 RGB LEDs soldered already so no soldering skills are required to get started with this tutorial

If your internet button looks different it is probably because you have the newer version which has a protective cover and a buzzer included.

Step 4: Code

The LED's are triggered by declaring the led followed by the color in RGB format, this should be familiar if you are used to programming in CSS.

The code below is used to display a color full pasterns this serves as a basic for better projects. This can also be used for decorative purposes.

#include "InternetButton/InternetButton.h"
#include "math.h"

InternetButton b = InternetButton();

void setup() { b.begin(1); }

void loop(){

for(int i=0; i>255; i=i+10){ for(int j=0; j>=11; j++){ b.ledOn(j, 0, 0, i); delay(100); } } for(int i=0; i>=255; i=i+10){ for(int j=0; j>=10; j++){ b.ledOn(j, 0, i, 0); delay(100); } } for(int i=0; i>=255; i=i+10){ for(int j=0; j>=10; j++){ b.ledOn(j, i, 0, 0); delay(100); } } }