You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
/**
|
|
|
|
* ESP32 Soundboard
|
|
|
|
*
|
|
|
|
* Hendriks Projekt
|
|
|
|
*
|
|
|
|
* https://dev.xd0.de/hendrik/soundboard
|
|
|
|
*/
|
|
|
|
#include "Arduino.h"
|
|
|
|
|
|
|
|
#define LED_PIN 21
|
|
|
|
|
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
// initialize LED digital pin as an output.
|
|
|
|
pinMode(LED_PIN, OUTPUT);
|
|
|
|
}
|
|
|
|
|
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
// turn the LED on (HIGH is the voltage level)
|
|
|
|
if ( touchRead(T0) < 50
|
|
|
|
// || touchRead(T1) < 50 // GPIO 00
|
|
|
|
// || touchRead(T2) < 50 // GPIO 02
|
|
|
|
|| touchRead(T3) < 50
|
|
|
|
|| touchRead(T4) < 50
|
|
|
|
|| touchRead(T5) < 50
|
|
|
|
|| touchRead(T6) < 50
|
|
|
|
|| touchRead(T7) < 50
|
|
|
|
|| touchRead(T8) < 20
|
|
|
|
|| touchRead(T9) < 20) {
|
|
|
|
digitalWrite(LED_PIN, HIGH);
|
|
|
|
} else {
|
|
|
|
// turn the LED off by making the voltage LOW
|
|
|
|
digitalWrite(LED_PIN, LOW);
|
|
|
|
}
|
|
|
|
|
|
|
|
// wait for a second
|
|
|
|
delay(1000);
|
|
|
|
}
|