diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/hiletgo_esp32_pinout.jpg b/hiletgo_esp32_pinout.jpg new file mode 100644 index 0000000..b06a981 Binary files /dev/null and b/hiletgo_esp32_pinout.jpg differ diff --git a/src/main3.cpp b/src/main3.cpp index a724ff8..4b782b0 100644 --- a/src/main3.cpp +++ b/src/main3.cpp @@ -1,24 +1,30 @@ +/* +This is a simple program that reads the capacitive touch sensor on pin4. If it is a low enough value +it will light up the builtin LED. +*/ #include -#include #define LED_BUILTIN 2 -int delayTime = 1000; +int delayTime = 100; +int read_value = 100; void setup() { - // put your setup code here, to run once: pinMode(LED_BUILTIN, OUTPUT); Serial.begin(115200); } void loop() { - // put your main code here, to run repeatedly: - Serial.println("Starting loop"); - digitalWrite(LED_BUILTIN, HIGH); - delay(delayTime); - digitalWrite(LED_BUILTIN, LOW); - Serial.println("Turning off LED"); - printf("This is main3.cpp!\n"); + read_value = touchRead(4); + Serial.println(touchRead(4)); + if (read_value < 10) + { + digitalWrite(LED_BUILTIN, HIGH); + } + else + { + digitalWrite(LED_BUILTIN, LOW); + } delay(delayTime); } \ No newline at end of file