Olimex LED Strip Programming with FastLED and codebender

Got prize from Olimex again. It was LED-STRIP-32. To make it works. I use Arduino Leonardo. I jump red wire to 5v, green wire to ground and white wire to data pin (I choose pin 3).

For coding, I use FastLED library that supports TM1804 chip. In order to programming with FastLED quickly, I use “codebender” web-based program that can program Arduino on-line. It includes FastLED library and has example code for using FastLED. Just modify it.

#include "FastLED.h"

#define NUM_LEDS 32
#define DATA_PIN 3

CRGB leds[NUM_LEDS];

void setup() { 
      FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
}

void loop() { 
  leds[0] = CRGB::Red;
  leds[1] = CRGB::Black;
  leds[30] = CRGB::Black;
  leds[31] = CRGB::Blue;
  FastLED.show();
  delay(500);

  leds[0] = CRGB::Black;
  leds[1] = CRGB::Green;
  leds[30] = CRGB::White;
  leds[31] = CRGB::Black;
  FastLED.show();
  delay(500);
}

Choose Arduino type and serial port. Press “Verify Code” then “Run on Arduino”. Some browser add-on may require to install. Finally, LEDs blink.

Olimex LED-STRIP-32

Olimex LED Strip

2 responses to “Olimex LED Strip Programming with FastLED and codebender

  1. Pingback: ใช้งาน Codebender เขียนโปรแกรมลง Arduino ผ่านเว็บได้เลย | Ultimateohm's Blog

  2. Pingback: Windows 10 บนสมารต์โฟน ใช้กับ Arduino | Ultimateohm's Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s