Changeset - 0dd7c07f8c8e
[Not reviewed]
default
0 1 0
Dennis Fink - 6 years ago 2018-02-06 23:42:56
dennis.fink@c3l.lu
Remove comment
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
Neopixel_Goggles.ino
Show inline comments
 
@@ -266,49 +266,49 @@ class NeoPatterns : public Adafruit_NeoP
 
      else if (WheelPos < 170) {
 
        WheelPos -= 85;
 
        return Color(0, WheelPos * 3, 255 - WheelPos * 3);
 
      }
 
      else {
 
        WheelPos -= 170;
 
        return Color(WheelPos * 3, 255 - WheelPos * 3, 0);
 
      }
 
    }
 

	
 
    void ColorSet(uint32_t color) {
 
      for (int i = 0; i < numPixels(); i++) {
 
        setPixelColor(i, color);
 
      }
 
    }
 
};
 

	
 
void RingsComplete();
 

	
 
NeoPatterns Rings(32, PIN, NEO_GRB + NEO_KHZ800, &RingsComplete);
 
uint8_t mode = 0;
 
uint32_t prev_time;
 

	
 
void setup() {
 
#ifdef __AVR_ATtiny85__ // Trinket, Gemma, etc.
 
#ifdef __AVR_ATtiny85__
 
  if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
 
#endif
 
  Rings.begin();
 
  Rings.setBrightness(BRIGHTNESS);
 
  Rings.RainbowCycle(random(RAINBOW_CYCLE_MIN_INTERVAL, RAINBOW_CYCLE_MAX_INTERVAL + 1));
 
  prev_time = millis();
 
}
 

	
 
void loop() {
 
  Rings.Update();
 
  /*
 
     We could store the return of the first millis call in a variable.
 
     But this routine is fast, so we only loose some milliseconds (if even)
 
     and we are not that time critical, that the MODE changes extacly after
 
     MODE_CHANGE_TIME. Calling millis twice, saves us 8 bytes, which is critical
 
     for the small storage space we have.
 
  */
 
  if ((millis() - prev_time) >= MODE_CHANGE_TIME) {
 
    mode = random(0, 9);
 
    prev_time = millis();
 
  }
 
}
 

	
 
void RingsComplete() {
0 comments (0 inline, 0 general)