I am trying to trigger an LED to stay on for 1.5 seconds when a momentary button is pressed. However, I am having a lot of trouble getting it to work. Any help would be appreciated.
Nothing in the body of the while loop changes the values of the variables in the condition you test. So without even thinking about it, one can say the code will do nothing OR get stuck infinite-like.
buttons are typically connected between the pin and ground, the pint configures as INPUT_PULLUP to use the internal pullup resistor which pulls the pin HIGH and when pressed, the button pulls the pin LOW.
if you're going to use a while loop, why not just do a delay (1500)?
Your original code had a while loop for the delay which would have blocked the code anyhow. You didn't mention any other functionality in your original post. This is why it is important to be clear as to requirements for your code.
Hi all. I have an espresso machine that I'd like to make some modifications to using an arduino. However, I've never used an arduino before and I've never programmed before so any help on programming/parts/feasibility would be greatly appreciated.
Here is what I want to do:
I want to add an RGB LCD screen, thermocouple, and push button. I want to have the LCD display the temperature of the thermocoil and change color with the temperature. When the button is pushed I want it to start the brew process and a timer on the LCD screen. When it is pressed a second time I want it to stop/reset the timer and stop the brew process.