Does anybody know of a sketch that can turn a single servo 180 degrees clockwise/counterclockwise with the x axis of a joystick, light a bar graph LED with the Y axis, and sound a buzzer when the joystick button is depressed.
1 Answers
You have a distinct set of requirements that you could turn into a sketch yourself. I'm guessing you have never written a program before, in which case the problem really is you don't know how to do what you want to.
So, break the problem down into small chunks. The less complex a problem the more likely you are to find a generic solution on the web that you can 'borrow'.
- How do you turn a servo?
- How do you read the position of a joystick?
- How do you light a LED bar graph?
- How do you sound a buzzer?
I'm pretty certain that you can find pages that tells you how to do each of those in separate sketches. Once you have each of those working you need to merge the setup functions, making sure they don't over write each other and then tackle the loop functions (which will be more difficult). BUT I know there are posts on here about how to merge two sketches into one.
I'm 99% certain you will not find a sketch that does what you want. I'm 99% certain you will be able to coble together a solution that will do what you want if you break it down.
If you get stuck, post the code you have and explain your problem and people will help.
Good luck.
- 5,652
- 1
- 17
- 31