From 3f971f90e6d0121d873c3c26a4944fa11fe4e889 Mon Sep 17 00:00:00 2001 From: thirdr Date: Tue, 8 Oct 2024 13:17:11 +0100 Subject: [PATCH] Examples: updated to clear both layers --- examples/multi-sensor-breakout/double_tap.py | 8 ++++++++ examples/multi-sensor-breakout/double_tap_async.py | 9 ++++++++- .../multi-sensor-breakout/explorer_sensor_stick_demo.py | 8 ++++++++ examples/multi-sensor-breakout/shake.py | 8 ++++++++ examples/multi-sensor-breakout/step_counter.py | 8 ++++++++ examples/multi-sensor-breakout/weather_station.py | 8 ++++++++ 6 files changed, 48 insertions(+), 1 deletion(-) diff --git a/examples/multi-sensor-breakout/double_tap.py b/examples/multi-sensor-breakout/double_tap.py index 92f491a..bd60c8b 100644 --- a/examples/multi-sensor-breakout/double_tap.py +++ b/examples/multi-sensor-breakout/double_tap.py @@ -4,6 +4,14 @@ WIDTH, HEIGHT = display.get_bounds() +# Clear all layers first +display.set_layer(0) +display.set_pen(BLACK) +display.clear() +display.set_layer(1) +display.set_pen(BLACK) +display.clear() + # Define our own pen here BG = display.create_pen(70, 130, 180) diff --git a/examples/multi-sensor-breakout/double_tap_async.py b/examples/multi-sensor-breakout/double_tap_async.py index 51323d7..c8ff24e 100644 --- a/examples/multi-sensor-breakout/double_tap_async.py +++ b/examples/multi-sensor-breakout/double_tap_async.py @@ -3,9 +3,16 @@ import asyncio import sys - WIDTH, HEIGHT = display.get_bounds() +# Clear all layers first +display.set_layer(0) +display.set_pen(BLACK) +display.clear() +display.set_layer(1) +display.set_pen(BLACK) +display.clear() + # Define our own pen for the background BG = display.create_pen(70, 130, 180) diff --git a/examples/multi-sensor-breakout/explorer_sensor_stick_demo.py b/examples/multi-sensor-breakout/explorer_sensor_stick_demo.py index 5ef59d1..1cbfde7 100644 --- a/examples/multi-sensor-breakout/explorer_sensor_stick_demo.py +++ b/examples/multi-sensor-breakout/explorer_sensor_stick_demo.py @@ -5,6 +5,14 @@ from breakout_bme280 import BreakoutBME280 import time +# Clear all layers first +display.set_layer(0) +display.set_pen(BLACK) +display.clear() +display.set_layer(1) +display.set_pen(BLACK) +display.clear() + try: ltr = BreakoutLTR559(i2c) lsm = LSM6DS3(i2c) diff --git a/examples/multi-sensor-breakout/shake.py b/examples/multi-sensor-breakout/shake.py index 2e727af..67aa1c2 100644 --- a/examples/multi-sensor-breakout/shake.py +++ b/examples/multi-sensor-breakout/shake.py @@ -4,6 +4,14 @@ WIDTH, HEIGHT = display.get_bounds() +# Clear all layers first +display.set_layer(0) +display.set_pen(BLACK) +display.clear() +display.set_layer(1) +display.set_pen(BLACK) +display.clear() + BG = display.create_pen(70, 130, 180) try: diff --git a/examples/multi-sensor-breakout/step_counter.py b/examples/multi-sensor-breakout/step_counter.py index 359ed51..b3efdaf 100644 --- a/examples/multi-sensor-breakout/step_counter.py +++ b/examples/multi-sensor-breakout/step_counter.py @@ -7,6 +7,14 @@ WIDTH, HEIGHT = display.get_bounds() +# Clear all layers first +display.set_layer(0) +display.set_pen(BLACK) +display.clear() +display.set_layer(1) +display.set_pen(BLACK) +display.clear() + # Some colours we'll need later on BG = display.create_pen(255, 99, 71) diff --git a/examples/multi-sensor-breakout/weather_station.py b/examples/multi-sensor-breakout/weather_station.py index 2372897..85acc4a 100644 --- a/examples/multi-sensor-breakout/weather_station.py +++ b/examples/multi-sensor-breakout/weather_station.py @@ -5,6 +5,14 @@ from pimoroni_explorer import display, i2c, BLACK, WHITE, RED import jpegdec +# Clear all layers first +display.set_layer(0) +display.set_pen(BLACK) +display.clear() +display.set_layer(1) +display.set_pen(BLACK) +display.clear() + try: bme = BreakoutBME280(i2c, address=0x76) except RuntimeError: