Skip to content

Instantly share code, notes, and snippets.

Last active January 14, 2022 02:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
from gpiozero import AngularServo
from guizero import App, Slider
#gpiozeroライブラリからServo とSliderのクラスをimportする
servo = AngularServo(18, min_pulse_width=0.5/1000, max_pulse_width=2.5/1000)
def slider_changed(angle):
servo.angle = int(angle)
app = App(title='Servo Angle', width=500, height=150)
slider = Slider(app, start=-90, end=90, command=slider_changed, width='fill', height=50)
slider.text_size = 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment