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 PIN_NEOPIXEL_ONBOARD 39
#define PIN_NEOPIXEL 9
#define PIN_NEOPIXEL 8
#define NEOPIXEL_POWER 38
#define PROTO_ICMP 1
@ -15,7 +15,7 @@
enum mode{Disco, Gauge};
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)
Adafruit_NeoPixel pixels(NUMPIXELS, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800);
@ -139,18 +139,19 @@ extern "C" void app_main()
// Arduino-like loop()
while(true){
int capacity = touchRead(8);
if (capacity > 20000) {
long cur_time = millis();
if (cur_time - last_touch > 500) {
active_mode = mode((active_mode + 1) % (Gauge + 1));
pixels.clear();
printf("changed mode: %u!\n", active_mode);
if (active_mode == Gauge) {
last_gauge_show = millis();
}
last_touch = cur_time;
}
}
//int capacity = touchRead(8);
//if (capacity > 20000) {
// long cur_time = millis();
// if (cur_time - last_touch > 500) {
// active_mode = mode((active_mode + 1) % (Gauge + 1));
// pixels.clear();
// printf("changed mode: %u!\n", active_mode);
// if (active_mode == Gauge) {
// last_gauge_show = millis();
// }
// last_touch = cur_time;
// }
//}
;
}
}