Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lowercase fonts, new mode for sending messages over serial #10

Open
wants to merge 12 commits into
base: experimental
Choose a base branch
from
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ RGB Shades described here: https://www.kickstarter.com/projects/macetech/rgb-led

When downloading ZIP file, remove "-master" at the end of the folder name before attempting
to open in the Arduino IDE

If your RGB Shades were purchased before July 2015:
This version has the standard Arduino bootloader. R9 and R10 near the control buttons will be present.
Select the “Arduino Pro or Pro Mini” option. Then, go back into the Tools menu and find the Processor option and select “ATmega328 (5V, 16MHz)”.

If your RGB Shades were purchased after July 2015:
This version has the Optiboot bootloader. R9 and 10 near the control buttons will be missing.
Select the “Arduino Mini” option. Then, go back into the Tools menu and find the Processor option and select “ATmega328”.
31 changes: 26 additions & 5 deletions RGBShades.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
// ZIP file https://github.com/FastLED/FastLED/archive/master.zip
//
// Use Arduino IDE 1.0 or later
// Select device "Arduino Pro or Pro Mini (5V, 16MHz) w/ATmega328
//
// If your RGB Shades were purchased before July 2015:
// This version has the standard Arduino bootloader. R9 and R10 near the control buttons will be present.
// Select the “Arduino Pro or Pro Mini” option.
// Then, go back into the Tools menu and find the Processor option and select “ATmega328 (5V, 16MHz)”.
//
// If your RGB Shades were purchased after July 2015:
// This version has the Optiboot bootloader. R9 and 10 near the control buttons will be missing.
// Select the “Arduino Mini” option.
// Then, go back into the Tools menu and find the Processor option and select “ATmega328”.
//
// [Press] the SW1 button to cycle through available effects
// Effects will also automatically cycle at startup
Expand All @@ -27,19 +36,20 @@
#define CHIPSET WS2811

// Global maximum brightness value, maximum 255
#define MAXBRIGHTNESS 72
#define MAXBRIGHTNESS 127
#define STARTBRIGHTNESS 127
byte currentBrightness = STARTBRIGHTNESS; // 0-255 will be scaled to 0-MAXBRIGHTNESS

// Include FastLED library and other useful files
#include <FastLED.h>
#include "messages.h"
#include "font.h"
#include "font2.h"
#include "XYmap.h"
#include "utils.h"
#include "effects.h"
#include "buttons.h"


// Runs one time at the start of the program (power up or reset)
void setup() {

Expand All @@ -52,9 +62,18 @@ void setup() {
// configure input buttons
pinMode(MODEBUTTON, INPUT_PULLUP);
pinMode(BRIGHTNESSBUTTON, INPUT_PULLUP);
Serial.begin(9600);

}

void serialEvent(){
if(Serial.available() == 0) return;
for (byte i = 0; i < sizeof(messageBuffer); i++) messageBuffer[i] = 0;
Serial.readBytesUntil('\n', messageBuffer, sizeof(messageBuffer));
effectInit = false;
}


// list of functions that will be displayed
functionList effectList[] = {threeSine,
threeDee,
Expand All @@ -69,7 +88,9 @@ functionList effectList[] = {threeSine,
scrollTextZero,
sideRain,
shadesOutline,
hearts};
hearts,
scrollTextSerial,
};

// Timing parameters
#define cycleTime 15000
Expand Down Expand Up @@ -112,7 +133,7 @@ void loop()
drawMeter(currentBrightness/16);
break;

}
}

// switch to a new effect every cycleTime milliseconds
if (currentMillis - cycleMillis > cycleTime && autoCycle == true) {
Expand Down
Loading