Heltec Httm Series Illuminated Capacitive Touch Switch Button Module 2.7V 6V
Rs. 42.00 Rs. 48.00
- Brand: https://heltec.org/project/touch-button/
- Product Code: SEN-TOUCH
- SKU -
- Availability: In Stock
- Price in reward points: 1
- For Bulk Order 9962060070
Quick support on WhatsApp (+919962060070) only between morning 11am-4pm, no call will be answered
Key Number | S- bond, D- double, T- triple bond, F- 4 constructed; | |
Version attribute |
| |
Backlight color | B- blue, R- crimson, G- yellow-inexperienced |
PACKAGE INCLUDES:
1 PCS x Heltec Httm Series Illuminated Capacitive Touch Switch Button Module 2.7V 6V
https://heltec.org/project/touch-button/
//SOURCE CODE TAKEN FROM BELOW LINK
//https://forum.arduino.cc/index.php?topic=524138.0
bool bButtonPressed = false;
uint8_t nButtonPin = 2, nLEDPin = 10;
uint16_t nOnTime = 0, nOffTime = 0;
void touchSwitchISR()
{
noInterrupts();
bButtonPressed = true;
}
void setup()
{
pinMode(nLEDPin, OUTPUT);
pinMode(nButtonPin, INPUT);
attachInterrupt(digitalPinToInterrupt(nButtonPin ), touchSwitchISR, RISING);
}
void loop()
{
if (bButtonPressed))
{
if (nOnTime == 0)
{
nOnTime = millis() + 10/*seconds*/ * 1000 /*milliseconds per second*/
digitalWrite(nLEDPin, HIGH);
}
else
{
if (millis() >= nOnTime)
{
digitalWrite(nLEDPin, LOW);
nOnTime = 0;
bButtonPressed = false;
interrupts();
}
}
}
}
15 DAYS