Hi there. I'm trying to switch ON an LED when I press a pushbutton and switch it OFF when I press it pushbutton again. When the LED is ON, I want to adjust the brightness using a potentiometer. I attempted to write a program to implement this but the button will switch ON the LED if the potentiometer is at minimum resistance and when I press the button again the LED wont go OFF. Can you please look at what I am doing wrong?? Thanks
Please don't post pictures of text. Just copy and paste the program and use the code button </>. That way other people can try your program on their Arduino.
Also. please post the complete program. The problem is often in the other part.
That is why we have posts telling you how to use this forum. It is cunningly disguised under the rather misleading name of “how to use this forum “ because it tells you how to use this forum. Why do so many beginners not read this?
Is it that we hide it away as the first sticky posts in every section? Have you a suggestion where we could put it so fewer people are arsed to read it?