|
@@ -1,4 +1,4 @@
|
|
|
-#include "lcd.h"
|
|
|
+#include "led_ring.h"
|
|
|
|
|
|
#include <Adafruit_NeoPixel.h>
|
|
|
#ifdef __AVR__
|
|
@@ -13,14 +13,18 @@
|
|
|
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
|
|
|
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
|
|
|
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
|
|
|
-Adafruit_NeoPixel strip = Adafruit_NeoPixel(6, LCD_PIN, NEO_GRB + NEO_KHZ800);
|
|
|
+Adafruit_NeoPixel strip = Adafruit_NeoPixel(6, LED_PIN, NEO_GRB + NEO_KHZ800);
|
|
|
|
|
|
// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
|
|
|
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
|
|
|
// and minimize distance between Arduino and first pixel. Avoid connecting
|
|
|
// on a live circuit...if you must, connect GND first.
|
|
|
|
|
|
-void lcd_setup() {
|
|
|
+uint32_t red = strip.Color(255, 0, 0);
|
|
|
+uint32_t green = strip.Color(0, 255, 0);
|
|
|
+uint32_t blue = strip.Color(0, 0, 255);
|
|
|
+
|
|
|
+void led_setup() {
|
|
|
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
|
|
|
#if defined (__AVR_ATtiny85__)
|
|
|
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
|
|
@@ -29,10 +33,24 @@ void lcd_setup() {
|
|
|
|
|
|
strip.begin();
|
|
|
strip.setBrightness(100);
|
|
|
+ delay(1); // Annoying flickering issues due to timing. I hate to use delay().
|
|
|
strip.show(); // Initialize all pixels to 'off'
|
|
|
}
|
|
|
|
|
|
-void lcd_examples() {
|
|
|
+void led_setall(uint32_t color) {
|
|
|
+ for(uint16_t i=0; i<strip.numPixels(); i++) {
|
|
|
+ strip.setPixelColor(i, color);
|
|
|
+ }
|
|
|
+ delay(1);
|
|
|
+ strip.show();
|
|
|
+}
|
|
|
+
|
|
|
+void led_setall(uint8_t red, uint8_t green, uint8_t blue) {
|
|
|
+ led_setall(strip.Color(red, green, blue));
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void led_examples() {
|
|
|
// Some example procedures showing how to display to the pixels:
|
|
|
colorWipe(strip.Color(255, 0, 0), 50); // Red
|
|
|
colorWipe(strip.Color(0, 255, 0), 50); // Green
|