Skip to content

Commit 26d137f

Browse files
committed
tided up files
1 parent 6eca36d commit 26d137f

8 files changed

+42
-5
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

calibration_test.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from servo import servo2040, Servo
2+
import plasma
3+
from plasma import WS2812
4+
from time import sleep
5+
import math
6+
7+
mouth = Servo(servo2040.SERVO_1)
8+
9+
# cal = mouth.calibration()
10+
# cal.first_value(-10)
11+
# cal.last_value(+40)
12+
# mouth.calibration(cal)
13+
14+
left_eye = Servo(servo2040.SERVO_3)
15+
right_eye = Servo(servo2040.SERVO_2)
16+
17+
val = -40
18+
left_eye.value(val)
19+
right_eye.value(-val)
20+
21+
sleep(1)

mood.py

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Moods
22

3+
# Moods:
4+
# * Angry (red eyes, eyes half closed)
5+
# * Happy (eyes wide, glowing white)
6+
# * Sleepy (leds dim, eyes half open)
7+
# * Sad (eyes half open, mouth half open, yellow lights dim)
8+
# * Shocked mouth open eyes wide, eyes strobing)
9+
# * Chatty (beak opens and closes a lot
10+
# * Bored (one eye half open, one eye open)
11+
# * Neutral (eyes open, blink every 10 seconds, yellow glow)
12+
# * Quirky - one eye open, one eye half, beak half open, rainbow colours
13+
314
class Mood():
415

516
cycle = 0
@@ -31,20 +42,25 @@ def start(self):
3142
self.cycle = 0
3243

3344
class Angry_Mood(Mood):
34-
# angry
35-
# red eyes
36-
# eyes half closed
37-
# mouth open and close
45+
"""
46+
Mood name: Angry
47+
Eye colour: red
48+
Eye Servos: both half closed
49+
Mouth: open and close
50+
"""
51+
3852
def __init__(self):
3953
self.super().__init__(name="angry", ticks=20)
4054

4155
def tick(self):
4256
super().tick()
57+
58+
4359

4460
class Quirky_mood(Mood):
4561
def __init__(self):
4662
self.super().__init__(name="angry", ticks=20)
47-
self.bubo
63+
self.bubo.left
4864

4965

5066
def tick(self):

0 commit comments

Comments
 (0)