TTP224 Programable Capacative 4 Channel Touch Switch
----------------------------------------------------------------------------------------------
[ Ссылка ] Get 5 boards in about a week for $27!
TTP224 - [ Ссылка ]
Arduino Test Code:
/***************************************************************
* TPP-244 CAPACATIVE TOUCH SENSOR *
* ARDUINO TEST WITH LEDs & SOUND *
* *
* (C)2023 LEARNELECTRONICS *
* WWW.YOUTUBE.COM/LEARNELECTRONICS *
* ARDUINO0169@GMAIL.COM *
* *
* ALL RIGHTS RESERVED *
* DISTRIBUTION WITH ATRIBUTION *
* IS PERMITTED *
***************************************************************/
//no libraries
//no variables
void setup() {
// put your setup code here, to run once:
pinMode(2,OUTPUT); //set pin 2 to output for led
pinMode(3,OUTPUT); //set pin 3 to output for led
pinMode(4,OUTPUT); // etc
pinMode(5,OUTPUT); // etc
pinMode(7,OUTPUT); // set pin 7 to output for buzzer
pinMode(9,INPUT); // set pin 9 to input from cap sensor out1
pinMode(10,INPUT); // set pin 10 to blahblahblah
pinMode(11,INPUT); // etc
pinMode(12,INPUT); // etc
digitalWrite(2, LOW); //turn off all leds
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(9)) { //if pin 9 is true
digitalWrite(2, HIGH); //turn on 1 led
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
tone(7, 1000, 500); //play a 1KHz tone for .5 sec
}
if (digitalRead(10)) {
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
tone(7, 1100, 500);
}
if (digitalRead(11)) {
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
tone(7, 1200, 500);
}
if (digitalRead(12)) {
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
tone(7, 1300, 500);
}
else { //if no button is pressed do nothing
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
}
}
------------------------------------------------------------------------------------------------------
*************************************************************************
*Please help support this channel at NO COST TO YOU. If you shop on* *Amazon, please use this link: [ Ссылка ] *
*I will get a small commission and it costs you nothing. *
*************************************************************************
HEY YOU ABOUT TO POST SOMETHING STUPID:
Yes, I know my hands are large/fat. It's because of a heart condition I suffer from called Congestive Heart Failure. Here's a link to some information about CHF: [ Ссылка ]
One of the symptoms is that it causes fluid retention, mostly in the hands, feet/ankles, and face..
-------------------------------------------------------------------------------------------------------------------
Support learnelectronics:
Amazon Store:
If you are shopping for electronic components, test gear or consumables please consider visiting my Amazon shop @ amazon.com/shop/learnelectronics
Patreon:
Please check out www.patreon.com/learnelectronics and pledge a dollar if you can. It will go a long way to keeping the channel alive. It costs a bit of money to buy all the items and produce these videos. Your help is appreciated.
Paypal:
Or....if you'd like to send a one-time donation you can use this link: paypal.me/learnelectronics
---------------------------------------------------------------------------------------------------------------------
Gear I use:
Multimeter: OWON B33+ [ Ссылка ]
Oscilloscope: KIPRIM DS1202 [ Ссылка ]
Signal generator: Junctek JDS8080 shorturl.at/ehTZ1
Component Tester: T7 Multifunction [ Ссылка ]
Soldering Station: Sealody ???????
Ещё видео!