I have been using the phi_interface library.
In one of my projects using a Node MCU V1.0 board alongwith the phi_interfaces for button debouncing.
I have come across a situation where I am doing teh finally integration that pin nos D3 and D4 alone work as expected. But if I try to use pin Nos D5 to D8 I find they report "Touched" status even without touching them .
/*
* Node MCU Pins available : D3/D4/D5/D6/D7/D8
* The pins D0/D1/D2/RX/TX are not used as free GPIO(DeepSLeep/Wire /Wire /Serial)
*/
#include <ESP8266WiFi.h>
#include <phi_interfaces.h>
// Define the user push button interface
#define shiftPB D3
#define incrPB D4
#define enterPB D8
#define total_buttons 3
char mapDIN[] = {'H', 'I', 'E'}; // This is a list of abbreviated name for each button.
byte pinDIN[] = {shiftPB, incrPB, enterPB}; // The digital pins connected to the 3 buttons.
phi_button_groups myDIN(mapDIN, pinDIN, total_buttons);
char ValidDIN = '0';
int checkValue;
//$$$$$$$ S E T U P $$$$$$$$$
void setup()
{
Serial.begin(9600);
}
//############# L O O P #################
void loop()
{
ValidDIN = myDIN.getKey();
if (ValidDIN == 'E' ) { // if pins D5, D6, D7, D8 are used then value increments once every 100ms
ValidDIN = '0'; // irrespective of these pins being grounded.
checkValue++;
Serial.println(checkValue);
}
delay(100);
}