change pin to A3, disable mode-switching

This commit is contained in:
Felix Pankratz 2023-12-24 19:58:31 +01:00
parent 6ac9b9a198
commit 8d88780e5a

View File

@ -5,7 +5,7 @@
#define NUMPIXELS 8 #define NUMPIXELS 8
#define PIN_NEOPIXEL_ONBOARD 39 #define PIN_NEOPIXEL_ONBOARD 39
#define PIN_NEOPIXEL 9 #define PIN_NEOPIXEL 8
#define NEOPIXEL_POWER 38 #define NEOPIXEL_POWER 38
#define PROTO_ICMP 1 #define PROTO_ICMP 1
@ -15,7 +15,7 @@
enum mode{Disco, Gauge}; enum mode{Disco, Gauge};
enum mode active_mode = Disco; enum mode active_mode = Disco;
char ssid[] = "MySSID"; // your network SSID (name) char ssid[] = "MyNetwork"; // your network SSID (name)
char pass[] = "MyPassphrase"; // your network password (use for WPA, or use as key for WEP) char pass[] = "MyPassphrase"; // your network password (use for WPA, or use as key for WEP)
Adafruit_NeoPixel pixels(NUMPIXELS, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800); Adafruit_NeoPixel pixels(NUMPIXELS, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);
@ -139,18 +139,19 @@ extern "C" void app_main()
// Arduino-like loop() // Arduino-like loop()
while(true){ while(true){
int capacity = touchRead(8); //int capacity = touchRead(8);
if (capacity > 20000) { //if (capacity > 20000) {
long cur_time = millis(); // long cur_time = millis();
if (cur_time - last_touch > 500) { // if (cur_time - last_touch > 500) {
active_mode = mode((active_mode + 1) % (Gauge + 1)); // active_mode = mode((active_mode + 1) % (Gauge + 1));
pixels.clear(); // pixels.clear();
printf("changed mode: %u!\n", active_mode); // printf("changed mode: %u!\n", active_mode);
if (active_mode == Gauge) { // if (active_mode == Gauge) {
last_gauge_show = millis(); // last_gauge_show = millis();
} // }
last_touch = cur_time; // last_touch = cur_time;
} // }
} //}
;
} }
} }