In this page, we'll go through the process of wiring and setting up a board with a Servo using Adafruit IO Wippersnapper.
Before you get started it will help to read these guide pages for more background information on servo motors too:
To control the servo from WipperSnapper we'll use its built in PWM, or pulse-width modulation, signal generation capabilities.
Yes - they will work the same as a regular servo. However, we do not provide a calibration system so you will need to determine the "center" point for your servo.
Make sure to wire your board like on the Hardware page. For this page, we're using the Feather ESP32 V2 as an example and wiring the servo to pin D14.
If you haven't already added your board to wippersnapper (i.e. if it doesn't show up here) click the green button below to see how to do that.
Now that you've already wired everything up, add your board to WipperSnapper, and verify that the board is connected, it's time to set up the servo on Adafruit IO.
First, make sure your device says it is online next to the board's name. If the board is offline but was previously connected, try moving it closer to your router.
Next, from the device page, click + New Component.
Set Servo Pin to D14, and keep the frequency at 50Hz.
The default minimum and maximum pulse widths for the "generic" servo are 500uS and 2500uS. Depending on the model of the servo, these defaults may not give your servo a full 180 degrees of motion. In that case, check your servo's datasheet to find the pulse widths it is designed to work with. Be aware that if you go too far you could break your servo!
Click Create Component.
Now, try moving the slider and you should see the servo move to the selected position as soon as you release the slider.
For this servo, the minimum position is at 500μs (0.5ms) which is all the way to the left. The middle position is 1500μs (1.5ms), and the maximum position, all the way to the right, is 2500μs (2.5ms).
Text editor powered by tinymce.