Update for using the CheapDuino from DFRobot. Use normal delay, may conserve battery as not calling code, dunno.

This commit is contained in:
Robert Marshall 2019-11-19 09:56:39 +00:00
parent a6427cc507
commit b6ae40907e
2 changed files with 15 additions and 5 deletions

View file

@ -8,9 +8,14 @@
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:nanoatmega328]
; [env:nanoatmega328]
; platform = atmelavr
; board = nanoatmega328
; framework = arduino
[env:atmegangatmega8]
platform = atmelavr
board = nanoatmega328
board = atmegangatmega8
framework = arduino
lib_deps=

View file

@ -4,16 +4,20 @@
#define COLOR_ORDER GRB
#define NUM_LEDS 12
#define LEFT_DATA_PIN 2
#define LEFT_DATA_PIN 9
CRGB leftLeds[NUM_LEDS];
#define RIGHT_DATA_PIN 3
#define RIGHT_DATA_PIN 11
CRGB rightLeds[NUM_LEDS];
#define BRIGHTNESS 255
#define FRAMES_PER_SECOND 60
#define LED_PIN 13
void setup() {
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, HIGH);
Serial.begin(115200);
FastLED.addLeds<LED_TYPE, LEFT_DATA_PIN, COLOR_ORDER>(leftLeds, NUM_LEDS).setCorrection(TypicalLEDStrip);
FastLED.addLeds<LED_TYPE, RIGHT_DATA_PIN, COLOR_ORDER>(rightLeds, NUM_LEDS).setCorrection(TypicalLEDStrip);
@ -31,7 +35,8 @@ void dots() {
}
void loop() {
digitalWrite(LED_PIN, millis() < 1000); // We need to keep the LED on for a bit to draw enough power for the boost circuit to stay on.
dots();
FastLED.show();
FastLED.delay(1000 / FRAMES_PER_SECOND);
delay(1000 / FRAMES_PER_SECOND);
}