In a recent article, we’ve seen how to control an Adafruit NeoPixel ring via mobile using Python and JQWidgets.

Let’s do something similar but using another very popular “actuator”: a Servo Motor, that is a rotary actuator used for precise control of angular position.

We’ll use Zerynth Studio to program the microcontroller-based board in Python and Zerynth App to run the JQWidget-based graphical user interface.

Required Material

First of all, you need a board. You can select one of the 32-bit microcontroller devices supported by Zerynth. We’ve chosen the Flip&Click by Mikroelektronika that carries the popular MCU SAM3X by Microchip .

by . You also need an element that allows you to connect the board to the internet. We’ve chosen the WiFi 4 Click by Mikrolektronika

by Mikrolektronika You also need a Servo Motor: we’ve chosen the very popular SG90 by TowerPro.





Last but not least, you need:

Zerynth Studio , our powerful IDE for embedded programming in Python that enables the IoT. You can download it here.

, our powerful IDE for embedded programming in Python that enables the IoT. You can download it here. Zerynth App. You can download it here.

Assembling

Just put the WiFi 4 Click on the slot “A” of the Flip&Click and connect the Servo as follows:

Brown wire of the Servo to the GND pin of the Flip&Click

Orange wire of the Servo to the 3.3V pin of the Flip&Click

Yellow wire of the Servo to a PWM pin of the Flip&Click (for example D2)

Programming

Once you have installed Zerynth Studio and created a Zerynth user, you have to register and virtualize the board. Take a look at the Zerynth official documentation for the Particle Photon for a quick getting started.

Now you can start to program your board in Python!

Create a new project and edit the main.py file as follows: