TTP224 4-Channel Touch Sensor Module with ESP32 | Touch-Activated Possibilities | English Subtitle

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 มี.ค. 2024
  • If you need any custom code for your projects, please contact me on Skype- G B RANJITKAR (message only/no calls) Not free, there will be a fee.
    TTP224 4-Channel Touch Sensor Module with ESP32 | Touch-Activated Possibilities | English Subtitle
    Code : code is on the comment below.
    Facebook : / doit20-104218935882053
    Please Subscribe my Channel. ThankYou!
    TTP224 4-Channel #touchscreen #sensor #module with #arduino | Touch-Activated Possibilities | English Subtitle

ความคิดเห็น • 1

  • @doit.20
    @doit.20  3 หลายเดือนก่อน

    int LD = 200; // Loop Delay. Do not change.
    void setup() {
    Serial.begin(9600);
    // out pins
    pinMode(26, OUTPUT); // LED for button 1
    pinMode(27, OUTPUT); // LED for button 2
    pinMode(14, OUTPUT); // LED for button 3
    pinMode(12, OUTPUT); // LED for button 4
    // input pins
    pinMode(32, INPUT_PULLUP); // Button 1 input pin 32
    pinMode(33, INPUT_PULLUP); // Button 2 input pin 33
    pinMode(25, INPUT_PULLUP); // Button 3 input pin 25
    pinMode(13, INPUT_PULLUP); // Button 4 input pin 13
    Serial.println("Robojax Test");
    }
    void loop() {
    // button 1 action
    if (digitalRead(32) == LOW) {
    Serial.println("Button 1 Touched ");
    digitalWrite(26, LOW); // Turn the LED ON
    delay(LD);
    } else {
    digitalWrite(26, HIGH); // Turn OFF the LED
    }
    // button 2 action
    if (digitalRead(33) == LOW) {
    Serial.println("Button 2 Touched ");
    digitalWrite(27, LOW); // Turn the LED ON
    delay(LD);
    } else {
    digitalWrite(27, HIGH); // Turn OFF the LED
    }
    // button 3 action
    if (digitalRead(25) == LOW) {
    Serial.println("Button 3 Touched ");
    digitalWrite(14, LOW); // Turn the LED ON
    delay(LD);
    } else {
    digitalWrite(14, HIGH); // Turn OFF the LED
    }
    // button 4 action
    if (digitalRead(13) == LOW) {
    Serial.println("Button 4 Touched ");
    digitalWrite(12, LOW); // Turn the LED ON
    delay(LD);
    } else {
    digitalWrite(12, HIGH); // Turn OFF the LED
    }
    }