Skip to content

Commit 98fa081

Browse files
committed
Merge branch 'main' into pixel_shader_fix
# Conflicts: # Buckaroo_Plant_Care_Bot/buckaroo_plant_care_bot.py
2 parents 7c8e7d2 + afa7683 commit 98fa081

39 files changed

Lines changed: 1628 additions & 267 deletions

File tree

Baudot_TTY/baudot_tty_GUI.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
clue.display.brightness = 1.0
29-
screen = displayio.Group(max_size=5)
29+
screen = displayio.Group()
3030

3131
VFD_GREEN = 0x00FFD2
3232
VFD_BG = 0x000505
@@ -65,11 +65,13 @@
6565

6666
messages_labels = {} # dictionary of configured messages_labels
6767

68-
message_group = displayio.Group(max_size=5, scale=1)
68+
message_group = displayio.Group(scale=1)
6969

7070
for message_config in messages_config:
7171
(name, textline, color, x, y) = message_config # unpack tuple into five var names
72-
message_label = label.Label(terminalio.FONT, text=textline, color=color, max_glyphs=50)
72+
message_label = label.Label(
73+
terminalio.FONT, text=textline, color=color, max_glyphs=50
74+
)
7375
message_label.x = x
7476
message_label.y = y
7577
messages_labels[name] = message_label

Baudot_TTY/baudot_tty_ble.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
ble = BLERadio()
2020
uart_server = UARTService()
2121
advertisement = ProvideServicesAdvertisement(uart_server)
22-
ble._adapter.name = "TTY_MACHINE" # pylint: disable=protected-access
22+
ble._adapter.name = "TTY_MACHINE" # pylint: disable=protected-access
2323

2424
# constants for sine wave generation
2525
SIN_LENGTH = 100 # more is less choppy
@@ -148,7 +148,8 @@ def baudot_bit(pitch=bit_1, duration=0.022): # spec says 20ms, but adjusted as
148148
# dac.stop()
149149

150150

151-
def baudot_carrier(duration=0.15): # Carrier is transmitted 150 ms before first character is sent
151+
def baudot_carrier(duration=0.15):
152+
# Carrier is transmitted 150 ms before first character is sent
152153
baudot_bit(carrier, duration)
153154
dac.stop()
154155

Buckaroo_Plant_Care_Bot/buckaroo_plant_care_bot.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,39 @@
1515
board.DISPLAY.brightness = 0.8
1616
clue.pixel.fill(0) # turn off NeoPixel
1717

18-
clue_display = displayio.Group(max_size=4)
18+
clue_display = displayio.Group()
1919

2020
# draw the dry plant
2121
dry_plant_file = open("dry.bmp", "rb")
2222
dry_plant_bmp = displayio.OnDiskBitmap(dry_plant_file)
23-
dry_plant_sprite = displayio.TileGrid(dry_plant_bmp, pixel_shader=getattr(dry_plant_bmp, 'pixel_shader', displayio.ColorConverter()))
23+
# CircuitPython 6 & 7 compatible
24+
dry_plant_sprite = displayio.TileGrid(
25+
dry_plant_bmp,
26+
pixel_shader=getattr(dry_plant_bmp, "pixel_shader", displayio.ColorConverter()),
27+
)
28+
# CircuitPython 7 compatible
29+
# dry_plant_sprite = displayio.TileGrid(
30+
# dry_plant_bmp, pixel_shader=dry_plant_bmp.pixel_shader
31+
# )
2432
clue_display.append(dry_plant_sprite)
2533

2634
# draw the happy plant on top (so it can be moved out of the way when needed)
2735
happy_plant_file = open("happy.bmp", "rb")
2836
happy_plant_bmp = displayio.OnDiskBitmap(happy_plant_file)
29-
happy_plant_sprite = displayio.TileGrid(happy_plant_bmp, pixel_shader=getattr(happy_plant_bmp, 'pixel_shader', displayio.ColorConverter()))
37+
# CircuitPython 6 & 7 compatible
38+
happy_plant_sprite = displayio.TileGrid(
39+
happy_plant_bmp,
40+
pixel_shader=getattr(happy_plant_bmp, "pixel_shader", displayio.ColorConverter()),
41+
)
42+
# CircuitPython 7 compatible
43+
# happy_plant_sprite = displayio.TileGrid(
44+
# happy_plant_bmp, pixel_shader=happy_plant_bmp.pixel_shader
45+
# )
3046
clue_display.append(happy_plant_sprite)
3147

3248
# Create text
3349
# first create the group
34-
text_group = displayio.Group(max_size=3, scale=3)
50+
text_group = displayio.Group(scale=3)
3551
# Make a label
3652
title_label = label.Label(terminalio.FONT, text="CLUE Plant", color=0x00FF22)
3753
# Position the label
@@ -45,7 +61,9 @@
4561
soil_label.y = 64
4662
text_group.append(soil_label)
4763

48-
motor_label = label.Label(terminalio.FONT, text="Motor off", color=0xFF0000, max_glyphs=9)
64+
motor_label = label.Label(
65+
terminalio.FONT, text="Motor off", color=0xFF0000, max_glyphs=9
66+
)
4967
motor_label.x = 4
5068
motor_label.y = 74
5169
text_group.append(motor_label)
@@ -62,13 +80,15 @@
6280
sense_pin = board.P1
6381
analog = AnalogIn(board.P1)
6482

83+
6584
def read_and_average(ain, times, wait):
6685
asum = 0
6786
for _ in range(times):
6887
asum += ain.value
6988
time.sleep(wait)
7089
return asum / times
7190

91+
7292
time.sleep(5)
7393

7494
while True:
@@ -86,7 +106,7 @@ def read_and_average(ain, times, wait):
86106
motor.value = True
87107
motor_label.text = "Motor ON"
88108
motor_label.color = 0x00FF00
89-
buzzer.duty_cycle = 2**15
109+
buzzer.duty_cycle = 2 ** 15
90110
time.sleep(0.5)
91111

92112
# always turn off quickly

CircuitPython_Display_Text/background_color_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
display = board.DISPLAY
1414

1515
# Make the display context
16-
main_group = displayio.Group(max_size=10)
16+
main_group = displayio.Group()
1717
display.show(main_group)
1818

1919
reg_label = label.Label(

CircuitPython_Display_Text/background_tight_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
display = board.DISPLAY
1515

1616
# Make the display context
17-
main_group = displayio.Group(max_size=10)
17+
main_group = displayio.Group()
1818
display.show(main_group)
1919

2020
font = bitmap_font.load_font("fonts/Fayette-HandwrittenScript-48.bdf")

CircuitPython_Display_Text/base_alignment_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
display = board.DISPLAY
1515

1616
# Make the display context
17-
main_group = displayio.Group(max_size=10)
17+
main_group = displayio.Group()
1818
display.show(main_group)
1919

2020

CircuitPython_Display_Text/color_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
display = board.DISPLAY
1414

1515
# Make the display context
16-
main_group = displayio.Group(max_size=10)
16+
main_group = displayio.Group()
1717
display.show(main_group)
1818

1919
reg_label = label.Label(

CircuitPython_Display_Text/colormask_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def wheel(pos):
3434
bg_palette[0] = 0xDDDD00
3535

3636
# Make the display context
37-
main_group = displayio.Group(max_size=10)
37+
main_group = displayio.Group()
3838
display.show(main_group)
3939

4040
font = bitmap_font.load_font("fonts/LeagueSpartan-Bold-16.bdf")

CircuitPython_Display_Text/display_text_anchored_position.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
display = board.DISPLAY
1515

1616
# Make the display context
17-
main_group = displayio.Group(max_size=10)
17+
main_group = displayio.Group()
1818
display.show(main_group)
1919
DISPLAY_WIDTH = 320
2020
DISPLAY_HEIGHT = 240
@@ -64,7 +64,7 @@
6464
text_area_bottom_right.anchor_point = (1.0, 1.0)
6565
text_area_bottom_right.anchored_position = (DISPLAY_WIDTH - 8, DISPLAY_HEIGHT - 8)
6666

67-
text_group = displayio.Group(max_size=9)
67+
text_group = displayio.Group()
6868
text_group.append(text_area_top_middle)
6969
text_group.append(text_area_top_left)
7070
text_group.append(text_area_top_right)

CircuitPython_Display_Text/font_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
display = board.DISPLAY
1616

1717
# Make the display context
18-
main_group = displayio.Group(max_size=10)
18+
main_group = displayio.Group()
1919
display.show(main_group)
2020

2121
font = bitmap_font.load_font("fonts/LeagueSpartan-Bold-16.bdf")

0 commit comments

Comments
 (0)