Initial commit

This commit is contained in:
Vivian Lim 2016-11-02 21:47:26 -07:00
commit 5a56fe2946
3 changed files with 143 additions and 0 deletions

View File

@ -0,0 +1,33 @@
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
To upload to your Gemma or Trinket:
1) Select the proper board from the Tools->Board Menu
2) Select USBtinyISP from the Tools->Programmer
3) Plug in the Gemma/Trinket, make sure you see the green LED lit
4) For windows, install the USBtiny drivers
5) Press the button on the Gemma/Trinket - verify you see
the red LED pulse. This means it is ready to receive data
6) Click the upload button above within 10 seconds
*/
int led = 1; // blink 'digital' pin 1 - AKA the built in red LED
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}

View File

@ -0,0 +1,55 @@
#include <bitswap.h>
#include <chipsets.h>
#include <color.h>
#include <colorpalettes.h>
#include <colorutils.h>
#include <controller.h>
#include <cpp_compat.h>
#include <dmx.h>
#include <FastLED.h>
#include <fastled_config.h>
#include <fastled_delay.h>
#include <fastled_progmem.h>
#include <fastpin.h>
#include <fastspi.h>
#include <fastspi_bitbang.h>
#include <fastspi_dma.h>
#include <fastspi_nop.h>
#include <fastspi_ref.h>
#include <fastspi_types.h>
#include <hsv2rgb.h>
#include <led_sysdefs.h>
#include <lib8tion.h>
#include <noise.h>
#include <pixelset.h>
#include <pixeltypes.h>
#include <platforms.h>
#include <power_mgt.h>
#include <Adafruit_NeoPixel.h>
#define PIN 0
#define NUM_LED 30
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LED, PIN, NEO_GRB + NEO_KHZ800);
CRGB leds[30];
int saturation = 192;
int brightness = 96;
void setup() {
FastLED.addLeds<NEOPIXEL, 0>(leds, 30);
}
void loop() {
// a
static uint8_t hue = 0;
for (int i=0; i<30; i++)
{
int hueOffset = (240/30) * i;
leds[i] = CHSV((hue + hueOffset) % 255, saturation, brightness);
}
hue++;
FastLED.show();
//FastLED.showColor(CHSV(hue++, 255, 255));
delay(5);
}

View File

@ -0,0 +1,55 @@
#include <bitswap.h>
#include <chipsets.h>
#include <color.h>
#include <colorpalettes.h>
#include <colorutils.h>
#include <controller.h>
#include <cpp_compat.h>
#include <dmx.h>
#include <FastLED.h>
#include <fastled_config.h>
#include <fastled_delay.h>
#include <fastled_progmem.h>
#include <fastpin.h>
#include <fastspi.h>
#include <fastspi_bitbang.h>
#include <fastspi_dma.h>
#include <fastspi_nop.h>
#include <fastspi_ref.h>
#include <fastspi_types.h>
#include <hsv2rgb.h>
#include <led_sysdefs.h>
#include <lib8tion.h>
#include <noise.h>
#include <pixelset.h>
#include <pixeltypes.h>
#include <platforms.h>
#include <power_mgt.h>
#include <Adafruit_NeoPixel.h>
#define PIN 0
#define NUM_LED 30
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LED, PIN, NEO_GRB + NEO_KHZ800);
CRGB leds[30];
int saturation = 192;
int brightness = 96;
void setup() {
FastLED.addLeds<NEOPIXEL, 0>(leds, 30);
}
void loop() {
// a
static uint8_t hue = 0;
for (int i=0; i<30; i++)
{
int hueOffset = (240/30) * i;
leds[i] = CHSV((hue + hueOffset) % 255, saturation, brightness);
}
hue++;
FastLED.show();
//FastLED.showColor(CHSV(hue++, 255, 255));
delay(5);
}