Tag Archives: Tutorial

Arduino Tutorial 32: Understanding and Using Joysticks in a Project

In this lesson we will explain how to hook up a Joystick. The easiest way to think of a joystick is to think of it as two independent potentiometer. Moving the joystick left and right changes one potentiometer, and moving the joystick up and down changes the other potentiometer. Also, pressing the knob on the joystick will activate a simple on/off switch. In this video we show you how to hook the joystick up, and then show you code that will allow you to read from the potentiometers and the switch.

If you want to follow along at home, you can order the Arduino Kit we are using HERE.

Typically, the servos in electronics kits are not the best ones, but are suitable to learn with. Heads up that in Lesson 33 we will be using a joystick to control two servos.  If you want to get ready for that lesson, go ahead and order your  HiTEC Servos.

This is the code that we developed in the video above.

 

Arduino Tutorial 29: Using Push Buttons to Create Dimmable LED

In this lesson we show you how to create a Dimmable LED using two pushbuttons. Pressing one button will gradually increase the brightness, while pressing the other button will gradually decrease the brightness. The project also includes an active buzzer to provide the user feedback that either maximum or minimum brightness have been reached. I encourage you to try and build this yourself before watching the video. Then see if you can do it on your own, and then see if you are doing the way I do it, or if you find an alternative suitable solution.

If you want to follow along at home, you can order the Arduino Kit we are using HERE.

Below is the code we used to achieve the toggle operation. The video gives details on how to connect up the circuit.

 

Arduino Tutorial 28: Using a Pushbutton as a Toggle Switch

In lesson 27 we learned how to incorporate a pushbutton into an arduino project. We learned how to utilize pull-up and pull-down resistors in order to incorporate a button into a circuit. The operation of the button in lesson 27 was pretty simple . . . if the button was held down, the LED would come on. When the button was released, the LED would turn back off. This is an interesting demonstration, but much more interesting is the case where we make a toggle switch. If you press and release the button, the LED comes on, and then if you press and release the button again, the LED goes off. While this sounds very similar to the previous case, it turns out to require a lot more thought. This video lesson explains how to think about this problem, and how to make it work.

If you want to follow along at home, you can order the Arduino Kit we are using HERE.

Below is the code we used to achieve the toggle operation. The video gives details on how to connect up the circuit.

 

Arduino Tutorial 22: Understanding and Using Active Buzzers to Add Sound to Your Project

In this lesson we show you how to add sound to your Arduino project using a buzzer, The Elegoo Super Starter kit contains two buzzers, an active buzzer and a passive buzzer. The active buzzer is the easiest to use, as you just need to apply 5 volts to it to get it to go off. In this lesson we show you how simple it is to use the active buzzer with Arduino. In future lessons we will show you how to use the passive buzzer.

The advantage of the active buzzer is that it is easier to use. Just apply 5 volts, and it goes off. The advantage of the passive buzzer is that it is cheaper, and allows you more control of the tone, or pitch of the sound produced.  If you want to follow along at home, you can order the Arduino Kit we are using HERE.

Arduino Tutorial 10: Understanding How To Read Analog Voltage using analogRead Command

So far in these lessons, we have just been using the Arduino output pins. If we actually want to read values from a sensor or other such components, we need to learn how to read values from the analog pins. These are pins A0 through A5. This lesson will teach you all about the analogRead command that allows you to interact with these pins. Enjoy!

In this new series of lessons, I will be using this Arduino kit.