first completely working version, no wifi
This commit is contained in:
parent
31c9c740b3
commit
347241bee2
@ -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
|
||||
|
||||
@ -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){
|
||||
|
||||
@ -170,6 +170,10 @@ void controlsCallback(ControlEvent event){
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_LED
|
||||
|
||||
#endif
|
||||
|
||||
void setup() {
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user