Hi, I'm wondering how I would get started using the joystick (pushing down on the joystick) in order to cause a light to turn on?
Thanks and sorry I'm a noob ![]()
Hi, I'm wondering how I would get started using the joystick (pushing down on the joystick) in order to cause a light to turn on?
Thanks and sorry I'm a noob ![]()
Pressing down on a joystick is the same as closing a normally open, momentary switch. When you release the stick, it opens the switch again. Take a look at the IDE code found under the menu File > Examples > 02.Digital > Button. Hook up and control your joystick button (sometimes called the Z axis) like the example (then integrate and improve the code!)
Do you have the specs or datasheet for the joystick? Or, do you know how to connect it?
Do you have the specs or datasheet for the light? Or is it a "regular little LED" or regular household lamp?
It's best to work on your input & output separately. For example, start with the [u]Blink Example[/u] and then connect your light to blink the light with the built-in LED.
Then read the joystick, maybe using the [u]Button Example[/u] or the Analog Read Serial Example, depending on how your joystick works.
Then when you can read the joystick and blink the light you can "connect" them with an [u]if-statement[/u].
...Realistically, turning-on a lamp with a switch/button doesn't require a microcontroller or programming if that's all you need to do. The Button Example does that, but it's just for learning. You could connect the LED directly to the button without the microcontroller in-between.