Update head tilt ears guide as well.
This commit is contained in:
parent
81ec22b354
commit
c852dcb3d7
1 changed files with 8 additions and 3 deletions
|
|
@ -16,15 +16,20 @@ import time
|
||||||
import busio
|
import busio
|
||||||
import board
|
import board
|
||||||
import adafruit_lis3dh
|
import adafruit_lis3dh
|
||||||
import simpleio
|
import pulseio
|
||||||
|
from adafruit_motor import servo
|
||||||
|
|
||||||
|
|
||||||
# Setup accelerometer
|
# Setup accelerometer
|
||||||
i2c = busio.I2C(board.ACCELEROMETER_SCL, board.ACCELEROMETER_SDA)
|
i2c = busio.I2C(board.ACCELEROMETER_SCL, board.ACCELEROMETER_SDA)
|
||||||
sensor = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19)
|
sensor = adafruit_lis3dh.LIS3DH_I2C(i2c, address=0x19)
|
||||||
|
|
||||||
# Setup servos
|
# Setup servos
|
||||||
left_ear = simpleio.Servo(board.A1)
|
left_pwm = pulseio.PWMOut(board.A1, frequency=50)
|
||||||
right_ear = simpleio.Servo(board.A2)
|
right_pwm = pulseio.PWMOut(board.A2, frequency=50)
|
||||||
|
|
||||||
|
left_ear = servo.Servo(left_pwm)
|
||||||
|
right_ear = servo.Servo(right_pwm)
|
||||||
|
|
||||||
#initialize things
|
#initialize things
|
||||||
left_ear.angle = 0
|
left_ear.angle = 0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue