Closed franky384 closed 3 years ago
Hi, you connect the buttons to GND in your example but in my sketch I'm looking for input state HIGH (https://github.com/fehlfarbe/arduino-motorfocus/blob/master/arduino-motorfocus.ino#L204) so you should connect the buttons to 5V like in this example: https://www.arduino.cc/en/tutorial/button
I have tried it like in that example, but as soon as i uploaded the code the motor begins to move slowly in conctantly changing directions, no matter what resistors i use to pulldown the buttons to ground. With the code in the .pdf from my first post the buttons work without any errors.
Should be fixed now. I activated the pullup resistors for button input and checked for BUTTON == LOW. So the wiring in your first post is correct.
First of all, thank you for sharing your code, but the push buttons never worked for me. So after some days of searching and trial and error i finally found a working solution. Maybe you can have a look at it ?
sketch_dec28a.html.pdf