|
|
@ -6,18 +6,15 @@
|
|
|
|
#include <HTTPUpdateServer.h>
|
|
|
|
#include <HTTPUpdateServer.h>
|
|
|
|
#include <WebServer.h>
|
|
|
|
#include <WebServer.h>
|
|
|
|
#include "e131.h"
|
|
|
|
#include "e131.h"
|
|
|
|
//#include <Adafruit_NeoPixel.h>
|
|
|
|
#include <FastLED.h>
|
|
|
|
#include <Adafruit_NeoPXL8.h>
|
|
|
|
|
|
|
|
//#include <FastLED.h>
|
|
|
|
|
|
|
|
//#include "FastLED_RGBW.h"
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "config.h"
|
|
|
|
#include <EEPROM.h>
|
|
|
|
#include <EEPROM.h>
|
|
|
|
#include <pico/stdlib.h>
|
|
|
|
#include <pico/stdlib.h>
|
|
|
|
#include <hardware/vreg.h>
|
|
|
|
#include <hardware/vreg.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int strips[LED_STRIPS] = {170, 170, 170, 170, 170, 170, 170, 170};
|
|
|
|
// Begin code
|
|
|
|
// Begin code
|
|
|
|
//bool core1_separate_stack = true;
|
|
|
|
bool core1_separate_stack = true;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define PRINTFUNC print
|
|
|
|
#define PRINTFUNC print
|
|
|
@ -29,24 +26,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
int calculate[LED_STRIPS * 4];
|
|
|
|
int calculate[LED_STRIPS * 4];
|
|
|
|
int universes[LED_STRIPS * 4];
|
|
|
|
int universes[LED_STRIPS * 4];
|
|
|
|
|
|
|
|
CRGB ledstrip[MAX_LEDS];
|
|
|
|
int strips[LED_STRIPS] = {MAX_LEDS, MAX_LEDS, MAX_LEDS, MAX_LEDS, MAX_LEDS, MAX_LEDS, MAX_LEDS, MAX_LEDS}; // for compatibility
|
|
|
|
int pins[8];
|
|
|
|
int8_t pins[LED_STRIPS] = {STRIP1, STRIP2, STRIP3, STRIP4, STRIP5, STRIP6, STRIP7, STRIP8};
|
|
|
|
|
|
|
|
//const int strips[LED_STRIPS] = {170, 170, 170, 170, 170, 170, 170, 170};
|
|
|
|
|
|
|
|
//int offsets[(LED_STRIPS+1)];
|
|
|
|
|
|
|
|
Adafruit_NeoPXL8 leds(170, pins, RGB_ORDER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// #ifdef RGBW_MODE
|
|
|
|
|
|
|
|
// // EVIL! hack to support RGBW ICs
|
|
|
|
|
|
|
|
// CRGBW leds[MAX_LEDS];
|
|
|
|
|
|
|
|
// CRGB *ledstrip = (CRGB *) &leds[0]; // yes, we just casted a 4-byte value array to a pseudo 3-byte value array
|
|
|
|
|
|
|
|
// int strips[LED_STRIPS] = {getRGBWsize(128), getRGBWsize(128), getRGBWsize(128), getRGBWsize(128), getRGBWsize(128), getRGBWsize(128), getRGBWsize(128), getRGBWsize(128)};
|
|
|
|
|
|
|
|
// #else
|
|
|
|
|
|
|
|
// int strips[LED_STRIPS] = {170, 170, 170, 170, 170, 170, 170, 170};
|
|
|
|
|
|
|
|
// CRGB ledstrip[MAX_LEDS];
|
|
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint8_t * livedata;
|
|
|
|
uint8_t * livedata;
|
|
|
|
// Networking
|
|
|
|
// Networking
|
|
|
@ -87,28 +68,16 @@ float airtemparray[TEMP_SAMPLES];
|
|
|
|
float cputemp;
|
|
|
|
float cputemp;
|
|
|
|
float airtemp;
|
|
|
|
float airtemp;
|
|
|
|
int datapos = 0;
|
|
|
|
int datapos = 0;
|
|
|
|
#ifdef RGBW_MODE
|
|
|
|
|
|
|
|
inline void setpixelrgb(int idx, byte r, byte g, byte b, byte w) {
|
|
|
|
|
|
|
|
leds.setPixelColor(idx, r, g, b, w);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
inline void setpixelrgb(int idx, byte r, byte g, byte b) {
|
|
|
|
|
|
|
|
leds.setPixelColor(idx, r, g, b);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
inline void showpixels() {
|
|
|
|
|
|
|
|
leds.show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class T> T print(T in) {
|
|
|
|
template <class T> T print(T in) {
|
|
|
|
if(Serial)
|
|
|
|
Serial.print(String(millis()/1000.0) + ": " + String(in));
|
|
|
|
Serial.print(String(millis()/1000.0) + ": " + String(in));
|
|
|
|
|
|
|
|
if(printer) clientbuffer += String(in);
|
|
|
|
if(printer) clientbuffer += String(in);
|
|
|
|
return (T)true;
|
|
|
|
return (T)true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template <class T> T println(T in) {
|
|
|
|
template <class T> T println(T in) {
|
|
|
|
if(Serial)
|
|
|
|
Serial.println(String(millis()/1000.0) + ": " + String(in));
|
|
|
|
Serial.println(String(millis()/1000.0) + ": " + String(in));
|
|
|
|
|
|
|
|
if(printer) {
|
|
|
|
if(printer) {
|
|
|
|
clientbuffer += String(in);
|
|
|
|
clientbuffer += String(in);
|
|
|
|
clientbuffer += "\n";
|
|
|
|
clientbuffer += "\n";
|
|
|
@ -214,9 +183,9 @@ void handleForm() {
|
|
|
|
if(reboot) {
|
|
|
|
if(reboot) {
|
|
|
|
EEPROM.commit();
|
|
|
|
EEPROM.commit();
|
|
|
|
for (int i = 0; i < MAX_LEDS; i++) {
|
|
|
|
for (int i = 0; i < MAX_LEDS; i++) {
|
|
|
|
setpixelrgb(i, 0, 0, 0);
|
|
|
|
ledstrip[i] = CRGB(0, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
showpixels();
|
|
|
|
FastLED.show();
|
|
|
|
ready = 3; // trigger core 1 to stop
|
|
|
|
ready = 3; // trigger core 1 to stop
|
|
|
|
delay(250);
|
|
|
|
delay(250);
|
|
|
|
rp2040.reboot();
|
|
|
|
rp2040.reboot();
|
|
|
@ -246,31 +215,28 @@ void handleNotFound() {
|
|
|
|
|
|
|
|
|
|
|
|
void write_universe(long universe, uint8_t data[], long size) {
|
|
|
|
void write_universe(long universe, uint8_t data[], long size) {
|
|
|
|
// universe starts at 0
|
|
|
|
// universe starts at 0
|
|
|
|
//print("Universe: ");
|
|
|
|
/*print("Universe: ");
|
|
|
|
//Serial.println(universe);
|
|
|
|
Serial.println(universe);
|
|
|
|
//print("Calculate size: ");
|
|
|
|
print("Calculate size: ");
|
|
|
|
//Serial.println(sizeof(calculate));
|
|
|
|
Serial.println(sizeof(calculate));*/
|
|
|
|
int offset = calculate[universe];
|
|
|
|
int offset = calculate[universe];
|
|
|
|
//print("Offset: ");
|
|
|
|
/*print("Offset: ");
|
|
|
|
//Serial.println(offset);
|
|
|
|
Serial.println(offset);
|
|
|
|
//print("Universes size: ");
|
|
|
|
print("Universes size: ");
|
|
|
|
//Serial.println(sizeof(universes));
|
|
|
|
Serial.println(sizeof(universes));*/
|
|
|
|
int write_size = universes[universe];
|
|
|
|
int write_size = universes[universe];
|
|
|
|
/*print("Length: ");
|
|
|
|
/*print("Length: ");
|
|
|
|
Serial.println(write_size * PIXEL_SIZE + (CHANNEL_START - 1) + 2);
|
|
|
|
Serial.println(write_size * PIXEL_SIZE + (CHANNEL_START - 1) + 2);
|
|
|
|
print("Data: ");
|
|
|
|
print("Data: ");
|
|
|
|
Serial.println(size);*/
|
|
|
|
Serial.println(size);*/
|
|
|
|
if (write_size * PIXEL_SIZE + (CHANNEL_START - 1) > size) {
|
|
|
|
if (write_size * PIXEL_SIZE + (CHANNEL_START - 1) + 2 > size) {
|
|
|
|
println("Write size too big!!");
|
|
|
|
println("Write size too big!!");
|
|
|
|
println(String(write_size * PIXEL_SIZE + (CHANNEL_START - 1)) + " with data size " + String(size));
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*if(offset + write_size > sizeof(ledstrip)) {
|
|
|
|
if(offset + write_size > sizeof(ledstrip)) {
|
|
|
|
println("Write size too big!!");
|
|
|
|
println("Write size too big!!");
|
|
|
|
println(String(offset + write_size) + " with strip size " + sizeof(ledstrip));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}*/
|
|
|
|
}
|
|
|
|
//status = 0;
|
|
|
|
//status = 0;
|
|
|
|
for (int i = 0; i < write_size; i++) {
|
|
|
|
for (int i = 0; i < write_size; i++) {
|
|
|
|
int j = i * PIXEL_SIZE + (CHANNEL_START - 1);
|
|
|
|
int j = i * PIXEL_SIZE + (CHANNEL_START - 1);
|
|
|
@ -282,11 +248,7 @@ void write_universe(long universe, uint8_t data[], long size) {
|
|
|
|
Serial.print(data[j+2]);
|
|
|
|
Serial.print(data[j+2]);
|
|
|
|
Serial.print(" ");
|
|
|
|
Serial.print(" ");
|
|
|
|
}*/
|
|
|
|
}*/
|
|
|
|
#ifdef RGBW_MODE
|
|
|
|
ledstrip[offset + i] = CRGB(data[j], data[j+1], data[j+2]);
|
|
|
|
setpixelrgb(offset + i, data[j], data[j+1], data[j+2]);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
setpixelrgb(offset + i, data[j], data[j+1], data[j+2]);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//ledstrip[strip].setPixelColor(i + offset, data[j], data[j+1], data[j+2]);
|
|
|
|
//ledstrip[strip].setPixelColor(i + offset, data[j], data[j+1], data[j+2]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//FastLED.show();
|
|
|
|
//FastLED.show();
|
|
|
@ -298,19 +260,16 @@ void write_universe(long universe, uint8_t data[], long size) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void setup() {
|
|
|
|
void setup() {
|
|
|
|
vreg_voltage v = VREG_VOLTAGE_1_20;
|
|
|
|
//vreg_voltage v = VREG_VOLTAGE_1_20;
|
|
|
|
vreg_set_voltage(v);
|
|
|
|
//vreg_set_voltage(v);
|
|
|
|
set_sys_clock_khz(252000, false);
|
|
|
|
//set_sys_clock_khz(252000, false);
|
|
|
|
pinMode(23, OUTPUT);
|
|
|
|
|
|
|
|
pinMode(23, HIGH);
|
|
|
|
|
|
|
|
Serial.begin(115200);
|
|
|
|
Serial.begin(115200);
|
|
|
|
//rp2040.wdt_begin(8000);
|
|
|
|
//rp2040.wdt_begin(8000);
|
|
|
|
pinMode(24, INPUT); // VBUS detect - check for USB connection
|
|
|
|
pinMode(24, INPUT); // VBUS detect - check for USB connection
|
|
|
|
if (digitalRead(24)) {
|
|
|
|
if (digitalRead(24)) {
|
|
|
|
delay(3000); // Wait for serial
|
|
|
|
delay(3000); // Wait for serial
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pinMode(21, INPUT);
|
|
|
|
pinMode(21, INPUT); // interrupt for W500
|
|
|
|
|
|
|
|
Serial.println("");
|
|
|
|
Serial.println("");
|
|
|
|
println("Starting RGB Controller...");
|
|
|
|
println("Starting RGB Controller...");
|
|
|
|
pinMode(20, OUTPUT);
|
|
|
|
pinMode(20, OUTPUT);
|
|
|
@ -364,7 +323,6 @@ void setup() {
|
|
|
|
EEPROM.commit();
|
|
|
|
EEPROM.commit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
IP_ADDR = IPAddress(EEPROM.read(0),EEPROM.read(1),EEPROM.read(2),EEPROM.read(3));
|
|
|
|
IP_ADDR = IPAddress(EEPROM.read(0),EEPROM.read(1),EEPROM.read(2),EEPROM.read(3));
|
|
|
|
//IP_ADDR = IPAddress(192,168,5,5);
|
|
|
|
|
|
|
|
if (!IP_ADDR.isSet())
|
|
|
|
if (!IP_ADDR.isSet())
|
|
|
|
ETH_MODE = "dhcp";
|
|
|
|
ETH_MODE = "dhcp";
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -515,16 +473,35 @@ void setup1() {
|
|
|
|
digitalWrite(LED_BUILTIN, HIGH);
|
|
|
|
digitalWrite(LED_BUILTIN, HIGH);
|
|
|
|
println("Initializing LED outputs and universe mappings...");
|
|
|
|
println("Initializing LED outputs and universe mappings...");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef STRIP1
|
|
|
|
|
|
|
|
pins[0] = STRIP1;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef STRIP2
|
|
|
|
|
|
|
|
pins[1] = STRIP2;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef STRIP3
|
|
|
|
|
|
|
|
pins[2] = STRIP3;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef STRIP4
|
|
|
|
|
|
|
|
pins[3] = STRIP4;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef STRIP5
|
|
|
|
|
|
|
|
pins[4] = STRIP5;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef STRIP6
|
|
|
|
|
|
|
|
pins[5] = STRIP6;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef STRIP7
|
|
|
|
|
|
|
|
pins[6] = STRIP7;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef STRIP8
|
|
|
|
|
|
|
|
pins[7] = STRIP8;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// Populate universes and offsets
|
|
|
|
// Populate universes and offsets
|
|
|
|
int offsetcount = 0;
|
|
|
|
int offsetcount = 0;
|
|
|
|
int currentsize = 0;
|
|
|
|
int currentsize = 0;
|
|
|
|
for (int i = 0; i < LED_STRIPS; i++) {
|
|
|
|
for (int i = 0; i < LED_STRIPS; i++) {
|
|
|
|
#ifdef RGBW_MODE
|
|
|
|
int tmp = strips[i];
|
|
|
|
int tmp = strips[i] * 3 / 4;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
int tmp = strips[i];
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print("Strip ");
|
|
|
|
print("Strip ");
|
|
|
|
Serial.print(i);
|
|
|
|
Serial.print(i);
|
|
|
@ -542,9 +519,7 @@ void setup1() {
|
|
|
|
Serial.print(", Light count ");
|
|
|
|
Serial.print(", Light count ");
|
|
|
|
Serial.print(MAX_PIXELS_PER_UNIVERSE);
|
|
|
|
Serial.print(MAX_PIXELS_PER_UNIVERSE);
|
|
|
|
Serial.print(", Size ");
|
|
|
|
Serial.print(", Size ");
|
|
|
|
Serial.print(MAX_PIXELS_PER_UNIVERSE * PIXEL_SIZE);
|
|
|
|
Serial.println(MAX_PIXELS_PER_UNIVERSE * PIXEL_SIZE);
|
|
|
|
Serial.print(", Offset ");
|
|
|
|
|
|
|
|
Serial.println(calculate[currentsize]);
|
|
|
|
|
|
|
|
offsetcount += MAX_PIXELS_PER_UNIVERSE;
|
|
|
|
offsetcount += MAX_PIXELS_PER_UNIVERSE;
|
|
|
|
currentsize += 1;
|
|
|
|
currentsize += 1;
|
|
|
|
tmp -= MAX_PIXELS_PER_UNIVERSE;
|
|
|
|
tmp -= MAX_PIXELS_PER_UNIVERSE;
|
|
|
@ -556,57 +531,49 @@ void setup1() {
|
|
|
|
Serial.print(", Light count ");
|
|
|
|
Serial.print(", Light count ");
|
|
|
|
Serial.print(tmp);
|
|
|
|
Serial.print(tmp);
|
|
|
|
Serial.print(", Size ");
|
|
|
|
Serial.print(", Size ");
|
|
|
|
Serial.print(tmp * PIXEL_SIZE);
|
|
|
|
Serial.println(tmp * PIXEL_SIZE);
|
|
|
|
Serial.print(", Offset ");
|
|
|
|
|
|
|
|
Serial.println(calculate[currentsize]);
|
|
|
|
|
|
|
|
offsetcount += tmp;
|
|
|
|
offsetcount += tmp;
|
|
|
|
currentsize += 1;
|
|
|
|
currentsize += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!leds.begin(true)) {
|
|
|
|
|
|
|
|
println("Failure to initialize LEDs!");
|
|
|
|
|
|
|
|
delay(1000);
|
|
|
|
|
|
|
|
//rp2040.reboot();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
println("LED driver initialized.");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
leds.setLatchTime(500);
|
|
|
|
#ifdef STRIP1
|
|
|
|
|
|
|
|
FastLED.addLeds<LED_TYPE, STRIP1, RGB_ORDER>(ledstrip, calculate[0], strips[0]);
|
|
|
|
for (uint32_t color = 0x440000; color > 0; color >>= 8) {
|
|
|
|
#endif
|
|
|
|
leds.fill(color);
|
|
|
|
#ifdef STRIP2
|
|
|
|
leds.show();
|
|
|
|
FastLED.addLeds<LED_TYPE, STRIP2, RGB_ORDER>(ledstrip, calculate[1], strips[1]);
|
|
|
|
delay(500);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#ifdef STRIP3
|
|
|
|
|
|
|
|
FastLED.addLeds<LED_TYPE, STRIP3, RGB_ORDER>(ledstrip, calculate[2], strips[2]);
|
|
|
|
for (int i=0; i<8; i++) {
|
|
|
|
#endif
|
|
|
|
if (pins && (pins[i] < 0)) {
|
|
|
|
#ifdef STRIP4
|
|
|
|
print("No leds on pin ");
|
|
|
|
FastLED.addLeds<LED_TYPE, STRIP4, RGB_ORDER>(ledstrip, calculate[3], strips[3]);
|
|
|
|
Serial.println(pins[i]);
|
|
|
|
#endif
|
|
|
|
continue; // No pixels on this pin
|
|
|
|
#ifdef STRIP5
|
|
|
|
}
|
|
|
|
FastLED.addLeds<LED_TYPE, STRIP5, RGB_ORDER>(ledstrip, calculate[4], strips[4]);
|
|
|
|
leds.fill(0);
|
|
|
|
#endif
|
|
|
|
uint32_t color = 0x0000aa;
|
|
|
|
#ifdef STRIP6
|
|
|
|
leds.fill(color, i * MAX_LEDS, MAX_LEDS);
|
|
|
|
FastLED.addLeds<LED_TYPE, STRIP6, RGB_ORDER>(ledstrip, calculate[5], strips[5]);
|
|
|
|
leds.show();
|
|
|
|
#endif
|
|
|
|
delay(300);
|
|
|
|
#ifdef STRIP7
|
|
|
|
}
|
|
|
|
FastLED.addLeds<LED_TYPE, STRIP7, RGB_ORDER>(ledstrip, calculate[6], strips[6]);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef STRIP8
|
|
|
|
|
|
|
|
FastLED.addLeds<LED_TYPE, STRIP8, RGB_ORDER>(ledstrip, calculate[7], strips[7]);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < MAX_LEDS; i++) {
|
|
|
|
for (int i = 0; i < MAX_LEDS; i++) {
|
|
|
|
setpixelrgb(i, 0, 0, 0);
|
|
|
|
ledstrip[i] = CRGB(0, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
showpixels();
|
|
|
|
FastLED.show();
|
|
|
|
|
|
|
|
|
|
|
|
// Test all lights
|
|
|
|
// Test all lights
|
|
|
|
#ifdef LIGHTTEST
|
|
|
|
/*for (int i = 0; i < MAX_LEDS; i++) {
|
|
|
|
for (int i = 0; i < MAX_LEDS; i++) {
|
|
|
|
ledstrip[i] = CRGB(0, 0, 50);
|
|
|
|
setpixelrgb(i, 0, 0, 50);
|
|
|
|
FastLED.show();
|
|
|
|
showpixels();
|
|
|
|
//delay(1);
|
|
|
|
delay(1);
|
|
|
|
ledstrip[i] = CRGB(0, 0, 0);
|
|
|
|
setpixelrgb(i, 0, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
FastLED.show();*/
|
|
|
|
showpixels();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//delay(3000);
|
|
|
|
//delay(3000);
|
|
|
|
|
|
|
|
|
|
|
|
ready += 1;
|
|
|
|
ready += 1;
|
|
|
@ -619,13 +586,9 @@ void setup1() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void loop() {
|
|
|
|
void loop() {
|
|
|
|
/* Parse a packet */
|
|
|
|
/* Parse a packet */
|
|
|
|
//println("Start loop");
|
|
|
|
//println("Start loop");
|
|
|
|
if (millis() % 100 > 50) { // reset LED
|
|
|
|
|
|
|
|
digitalWrite(LED_BUILTIN, HIGH);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(channels = e131.parsePacket()) {
|
|
|
|
if(channels = e131.parsePacket()) {
|
|
|
|
// Offset by start universe
|
|
|
|
// Offset by start universe
|
|
|
@ -662,11 +625,7 @@ void loop() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void loop1() {
|
|
|
|
void loop1() {
|
|
|
|
//rp2040.wdt_reset();
|
|
|
|
rp2040.wdt_reset();
|
|
|
|
if (millis() % 100 < 50) {
|
|
|
|
|
|
|
|
//status = 0;
|
|
|
|
|
|
|
|
digitalWrite(LED_BUILTIN, LOW);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(BOOTSEL) {
|
|
|
|
if(BOOTSEL) {
|
|
|
|
bootsel_count++;
|
|
|
|
bootsel_count++;
|
|
|
|
delay(50);
|
|
|
|
delay(50);
|
|
|
@ -695,15 +654,21 @@ void loop1() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
status2 = 1;
|
|
|
|
status2 = 1;
|
|
|
|
if(status == 1 && e131.universe > START_UNIVERSE - 1 && channels > 0) {
|
|
|
|
if(status == 1 && e131.universe > START_UNIVERSE - 1 && channels > 0) {
|
|
|
|
write_universe(e131.universe - START_UNIVERSE - 1, livedata, channels);
|
|
|
|
write_universe(e131.universe - START_UNIVERSE, livedata, channels);
|
|
|
|
showpixels();
|
|
|
|
FastLED.show();
|
|
|
|
//println("Done Writing");
|
|
|
|
//println("Done Writing");
|
|
|
|
status = 0;
|
|
|
|
status = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
status2 = 0;
|
|
|
|
status2 = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (millis() % 100 > 50) { // reset LED
|
|
|
|
|
|
|
|
digitalWrite(LED_BUILTIN, HIGH);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (millis() % 100 < 50 && status == 1) {
|
|
|
|
|
|
|
|
//status = 0;
|
|
|
|
|
|
|
|
digitalWrite(LED_BUILTIN, LOW);
|
|
|
|
|
|
|
|
}
|
|
|
|
//status = 0;
|
|
|
|
//status = 0;
|
|
|
|
//delay(50);
|
|
|
|
//delay(50);
|
|
|
|
float cputemp2 = analogReadTemp();
|
|
|
|
float cputemp2 = analogReadTemp();
|
|
|
|