The GPIO driver for Servos uses a special form of PWM to control servos from the Builder Base. The selected pin includes an optional initial value.
The GPIO driver for Digital Inputs has one parameter that have to be configured:
Any GP pin on the Builder Base if not already used
The GP0 pin on the Builder Base is directly connected to the pulse pin on the Servo. The 5v and GND lines are then connected between the Builder Base and the Servo.
The voltage level for the assembly
The ground potential for the assembly
GP0 (can be any GP pin)
The GP output pin
How to write an App
Navigate to the App Builder and create a new application. You can find the “Servo” code object under the “Hardware” Tab in the object drop down menu on the left, or you can also use the search bar.
Drag the “Servo” Object onto the canvas.
Next, locate the “Input Number” Object under the Interface tab and drag three instances of it onto the canvas.
Finally, connect the “Number” port from one of each of the Input Number Objects to the “Degrees”, “Offsets”, and “180 Offsets” ports on the Servo Object and save your application.
How to create a firmware
Navigate to the Firmware Builder and create a new firmware file.
Click the “+ Add Hardware” button which will open a modal window. Scroll down in the list to find the “Generic” section and select the “Digital Out” hardware option.
Give your device a name, and click “Add Device”
Next, select the “GPIO” driver under the driver dropdown menu, set the Pin.
For this example we select:
You may now save your firmware file and upload it to one of your clients.