-
Notifications
You must be signed in to change notification settings - Fork 0
/
teensy_firmware.cpp
35 lines (30 loc) · 993 Bytes
/
teensy_firmware.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <Arduino.h>
#include "core/firmware.h"
#include "teensy_device.h"
#include "teensy4ledcontroller.h"
#include "common/constants.h"
CRGB leds[common::constants::TOTAL_NUM_LEDS];
byte pinList[1] = { 38 };
DMAMEM uint8_t displayMemory[common::constants::TOTAL_NUM_LEDS * 3];
uint8_t drawingMemory[common::constants::TOTAL_NUM_LEDS * 3];
OctoWS2811 octo(common::constants::TOTAL_NUM_LEDS, displayMemory, drawingMemory, WS2811_RGB | WS2811_800kHz, 1, pinList);
CTeensy4Controller<GRB, WS2811_800kHz>* pcontroller;
TeensyDevice device{leds};
core::Firmware firmware{device};
void setup()
{
device.sd_init();
octo.begin();
pcontroller = new CTeensy4Controller<GRB, WS2811_800kHz>(&octo);
FastLED.setBrightness(255);
FastLED.addLeds(pcontroller, leds, common::constants::TOTAL_NUM_LEDS);
FastLED.clear();
FastLED.setMaxPowerInVoltsAndMilliamps(5, 900);
delay(50);
FastLED.show();
device.serial_begin(9600);
}
void loop()
{
firmware.update();
}