Skip to content

Commit 7ca3ecb

Browse files
Merge pull request adafruit#1265 from adafruit/pb-moon-clock
Matrix Eyes: fix initial position bug, add Adabot eyes
2 parents 0c937d1 + a162f7f commit 7ca3ecb

File tree

6 files changed

+20
-2
lines changed

6 files changed

+20
-2
lines changed

Matrix_Portal_Eyes/code.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from eyes.werewolf.data import EYE_DATA
1616
#from eyes.cyclops.data import EYE_DATA
1717
#from eyes.kobold.data import EYE_DATA
18+
#from eyes.adabot.data import EYE_DATA
1819

1920
# UTILITY FUNCTIONS AND CLASSES --------------------------------------------
2021

@@ -89,8 +90,8 @@ def __init__(self, filename, transparent=None):
8990
EYE_DATA['lower_lid_closed'][0]),
9091
max(EYE_DATA['lower_lid_open'][1],
9192
EYE_DATA['lower_lid_closed'][1]))
92-
EYE_PREV = EYE_CENTER
93-
EYE_NEXT = EYE_CENTER
93+
EYE_PREV = (0, 0)
94+
EYE_NEXT = (0, 0)
9495
MOVE_STATE = False # Initially stationary
9596
MOVE_EVENT_DURATION = random.uniform(0.1, 3) # Time to first move
9697
BLINK_STATE = 2 # Start eyes closed
2.08 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
""" Configuration data for the Adabot eyes """
2+
EYE_PATH = __file__[:__file__.rfind('/') + 1]
3+
EYE_DATA = {
4+
'eye_image' : EYE_PATH + 'adabot-eyes.bmp',
5+
'upper_lid_image' : EYE_PATH + 'adabot-upper-lids.bmp',
6+
'lower_lid_image' : EYE_PATH + 'adabot-lower-lids.bmp',
7+
'stencil_image' : EYE_PATH + 'adabot-stencil.bmp',
8+
'transparent' : (255, 0, 0), # Transparent color in above images
9+
'eye_move_min' : (5, -1), # eye_image (left, top) move limit
10+
'eye_move_max' : (13, 7), # eye_image (right, bottom) move limit
11+
'upper_lid_open' : (13, -5), # upper_lid_image pos when open
12+
'upper_lid_center' : (13, -5), # " when eye centered
13+
'upper_lid_closed' : (13, 7), # " when closed
14+
'lower_lid_open' : (13, 22), # lower_lid_image pos when open
15+
'lower_lid_center' : (13, 22), # " when eye centered
16+
'lower_lid_closed' : (13, 15), # " when closed
17+
}

0 commit comments

Comments
 (0)