Compare commits
2 Commits
v1.4.11
...
8c7fc159d3
Author | SHA1 | Date | |
---|---|---|---|
8c7fc159d3 | |||
476d3e82e2 |
@@ -82,7 +82,7 @@ Discord Server: [https://discord.gg/my7Gvaxj2v](https://discord.gg/my7Gvaxj2v)
|
||||
| PN532 SCL | 22 |
|
||||
| TTP223 I/O | 25 |
|
||||
|
||||
**!! Achte darauf, dass am PN532 die DIP-Schalter auf I2C gestellt sind**
|
||||
**!! Achte darauf, dass am PN532 die DIP-Schalter auf I2C gestellt sind**
|
||||
**Nutze den 3V Pin vom ESP für den Touch Sensor**
|
||||
|
||||

|
||||
|
@@ -86,7 +86,7 @@ Discord Server: [https://discord.gg/my7Gvaxj2v](https://discord.gg/my7Gvaxj2v)
|
||||
| PN532 SCL | 22 |
|
||||
| TTP223 I/O | 25 |
|
||||
|
||||
**!! Make sure that the DIP switches on the PN532 are set to I2C**
|
||||
**!! Make sure that the DIP switches on the PN532 are set to I2C**
|
||||
**Use the 3V pin from the ESP for the touch sensor**
|
||||
|
||||

|
||||
|
13
src/main.cpp
13
src/main.cpp
@@ -15,6 +15,7 @@
|
||||
|
||||
bool mainTaskWasPaused = 0;
|
||||
uint8_t scaleTareCounter = 0;
|
||||
bool touchSensorConnected = false;
|
||||
|
||||
// ##### SETUP #####
|
||||
void setup() {
|
||||
@@ -59,6 +60,16 @@ void setup() {
|
||||
|
||||
// Touch Sensor
|
||||
pinMode(TTP223_PIN, INPUT_PULLUP);
|
||||
if (digitalRead(TTP223_PIN) == HIGH)
|
||||
{
|
||||
Serial.println("Touch Sensor is not connected");
|
||||
touchSensorConnected = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Serial.println("Touch Sensor is connected");
|
||||
touchSensorConnected
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +111,7 @@ void loop() {
|
||||
unsigned long currentMillis = millis();
|
||||
|
||||
// Überprüfe den Status des Touch Sensors
|
||||
if (digitalRead(TTP223_PIN) == HIGH && currentMillis - lastButtonPress > debounceDelay)
|
||||
if (touchSensorConnected && digitalRead(TTP223_PIN) == HIGH && currentMillis - lastButtonPress > debounceDelay)
|
||||
{
|
||||
lastButtonPress = currentMillis;
|
||||
scaleTareRequest = true;
|
||||
|
Reference in New Issue
Block a user