In this class, you will learn how to use an Arduino in a more advanced way: you will be building a servo-controlled laser pointer. The three hours will switch between instruction, hands-on and some free time. Example programs will be provided. You can cut and paste from the examples to start writing your own programs.
The class fee includes the servos and the laser diode. Please bring a laptop with the Arduino software and drivers pre-installed as well as your Arduino compatible board. The software may be downloaded online.
If you bring your own laptop, you MUST pre-download and install the Arduino software and drivers.
You must make arrangements for a computer before signing up for the class - either be able to bring a laptop, or call the shop for assistance.
A GitHub repo has been created which houses all of the course material including a course document PDF as well as a ZIP with all the course material including code.
You will be working with and given all the supplies listed below; please note you must supply your own Arduino
1 x Laser diode
1 x Pan/tilt module
1 x 2-axis joystick
In the Arduino 1 class, we covered the topic of pulse width modulation (PWM); we will revisit that concept in this chapter and see how it is used to control servos. We'll be covering the following concepts:
- pulse width, voltage and period
- duty cycle
- servo control
We're now going to look into the basics of controlling a servo with the Arduino as well as how to use a library to make this task a lot easier. We'll be covering the following concepts:
- Servo library
for()
loopwhile()
loop
In this final chapter we will be using a simple 2-axis joystick to control our servos; we'll be covering the following concepts:
- potentiometers as joysticks
- smoothing arrays