In this video lesson we show how you can control a PIO State Machine on the Raspberry Pi Pico W inside of a micropython class. We demonstrate with the practical example of controlling servos with a servo Class which we create. The objective is to ‘hide’ all the complex code in the class, allowing less adept users to interact with the servo with simple python commands. For your convenience the code developed in this video is included below. Enjoy!
In this video lesson we show how you can use the Raspberry Pi Pico PIO State Machine to sweep a servo through its full range of motion. The video will take you through things step-by-step. For your convenience the code developed in the video is included below. Enjoy!
In this video tutorial we show you how you can use a Raspberry Pi Pico PIO Statemachine to control the position of a servo. For your convenience, the code from this lesson is presented below. Enjoy!
In this video I show how to use both cores on the Raspberry Pi Pico W. We will explore an example using threading where we will operate 2 LED and a servo.
In this lesson we demonstrate how to create a custom library on the Raspberry Pi Pico W to control a servo. We create a servo class, and then show how to use it as a library in future programs.
Python
1
2
3
4
5
6
7
8
9
10
classservo:
def__init__(self,sPin):
importmachine
self.servoPin=sPin
self.obj=machine.PWM(machine.Pin(self.servoPin))
self.obj.freq(50)
defpos(self,angle):
writeVal=6553/180*angle+1638
self.obj.duty_u16(int(writeVal))
Making The World a Better Place One High Tech Project at a Time. Enjoy!
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok