Hi!
I made a project with esp8266, servo995 and ttp223.
Powered by 5v 2A with batteries
The problem is that when everything turns on, I press the touch button, the code does not work.
If you reboot the esp8266 after turning it on, the code will start working.
Problem After restarting the ESP8266, the servo can be rotated with the touch button for a maximum of 3 times. Then ttp223 accepts everything, but the servo does not rotate
You have set pin 4 as an INPUT and are testing for HIGH on that pin to signal that the button has been touched. Have you got a pulldown resistor in the circuit keeping the input LOW when the button is not touched ?
A 10K resistor from the pin to GND would be a good starting point, but are you sure that the ttp223 is behaving itself and outputting what you expect it to ?
I think there is a reason for this. But I think that the most important mistake is improper nutrition.
Because when powered from a 5 V 2 A network, it works adequately.
If you connect a 5V 2.4A battery, it doesn't work after 2 times for some reason. Please tell me why this is so. Where am I wrong about something