import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) gp_out = 4 GPIO.setup(gp_out, GPIO.OUT) servo = GPIO.PWM(gp_out, 50) servo.start(0) time.sleep(0.2) servo.ChangeDutyCycle(7.5) time.sleep(2) servo.ChangeDutyCycle(2.5) time.sleep(2) servo.stop() GPIO.cleanup() pi@raspberrypi:~ $ mkdir nwt pi@raspberrypi:~ $ cd nwt pi@raspberrypi:~/nwt $ vi servo.py ターミナルのコマンド servo.py 1. 2.