Not sure I am understanding the desired outcome, but your while loop is not re-reading GPIO5 in the loop, so it just adds the same value 20 times (zero?)
Also, GPIO5 is a digital input (not analog) so it can only give 0 or 1.
Also, GPIO5 is a digital input (not analog) so it can only give 0 or 1.
Statistics: Posted by neilgl — Sun Sep 08, 2024 6:58 pm