first completely working version, no wifi

This commit is contained in:
Daan Meijer 2025-01-24 22:36:10 +01:00
parent 31c9c740b3
commit 347241bee2
4 changed files with 12 additions and 4 deletions

View File

@ -46,6 +46,7 @@ board_build.f_cpu = 80000000L
board = dfrobot_beetle_esp32c3
platform = espressif32
framework = arduino
; board_build.f_cpu = 80000000L
monitor_speed = 460800
lib_deps =
fastled/FastLED@^3.7.0

View File

@ -41,10 +41,13 @@ void Controls_loop(void *pvParameters){
while(true){
for(uint8_t a=0; a<sizeof(controlPins); a++){
auto pin = controlPins[a];
auto currentValue = analogRead(pin) > 3072;
auto currentValueAnalog = analogRead(pin);
auto currentValue = currentValueAnalog > 3072;
auto prevValue = prevState[a];
// Serial.printf("Pin %d: %d->%d\n", pin, prevValue, currentValue);
if(CONTROLS_DEBUG){
Serial.printf("Pin %d: %d->%d (%d)\n", pin, prevValue, currentValue, currentValueAnalog);
}
// if(abs(currentValue - prevValue) > 100){
if(currentValue != prevValue){

View File

@ -170,6 +170,10 @@ void controlsCallback(ControlEvent event){
}
#endif
#ifdef ENABLE_LED
#endif
void setup() {

View File

@ -20,8 +20,8 @@
#include <NeoPixelBus.h>
#endif
#define PIN_STRIP1 8
#define PIN_STRIP2 9
#define PIN_STRIP1 5
#define PIN_STRIP2 6
#define STRIP_LENGTH 46