fehlfarbe / arduino-motorfocus

Arduino motorfocus with moonlite protocol for telescopes
MIT License
49 stars 13 forks source link

Buttons not worked for me, here is my solution. #2

Closed franky384 closed 3 years ago

franky384 commented 5 years ago

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 ?

untitled sketch_steckplatine

sketch_dec28a.html.pdf

fehlfarbe commented 5 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

franky384 commented 5 years ago

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.

fehlfarbe commented 5 years ago

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.