From 8637967605b20a99aec4d8e639084d76dea13169 Mon Sep 17 00:00:00 2001 From: Gee Bartlett <122281230+ageeandakeyboard@users.noreply.github.com> Date: Fri, 3 Feb 2023 12:53:14 +0000 Subject: [PATCH] Made edits from review --- examples/interstate75/interstate75_example.cpp | 5 ++++- libraries/interstate75/README.md | 3 +++ libraries/interstate75/interstate75.hpp | 1 + micropython/modules_py/interstate75.md | 4 ++-- micropython/modules_py/interstate75.py | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/interstate75/interstate75_example.cpp b/examples/interstate75/interstate75_example.cpp index 1ed37bd8..f36147d5 100644 --- a/examples/interstate75/interstate75_example.cpp +++ b/examples/interstate75/interstate75_example.cpp @@ -13,8 +13,11 @@ PicoGraphics_PenRGB888 graphics(hub75.width, hub75.height, nullptr); // And each button Button button_a(Interstate75::A); -Button button_b(Interstate75::B); +// For the Interstate75 +// Button button_b(Interstate75::BOOT); // Using this button definition on the Interstate75W will most likely disable the wifi make sure it is commented out if using Interstate75W +// Or for the Interstate75W +Button button_b(Interstate75::B); // This button is not present on the Interstate75 (non W version) // RGB LED RGBLED led(Interstate75::LED_R, Interstate75::LED_G, Interstate75::LED_B, ACTIVE_LOW); diff --git a/libraries/interstate75/README.md b/libraries/interstate75/README.md index 817fdf68..73f542f5 100644 --- a/libraries/interstate75/README.md +++ b/libraries/interstate75/README.md @@ -27,6 +27,9 @@ PicoGraphics_PenRGB888 graphics(hub75.width, hub75.height, nullptr); // And each button Button button_a(Interstate75::A); +// For the Interstate75 +Button button_b(Interstate75::BOOT); +// Or for the Interstate75W Button button_b(Interstate75::B); // RGB LED diff --git a/libraries/interstate75/interstate75.hpp b/libraries/interstate75/interstate75.hpp index 28ac8838..69c91866 100644 --- a/libraries/interstate75/interstate75.hpp +++ b/libraries/interstate75/interstate75.hpp @@ -9,6 +9,7 @@ namespace pimoroni { namespace Interstate75{ static const uint8_t A = 14; static const uint8_t B = 15; + static const uint8_t BOOT = 23; static const uint8_t LED_R = 16; static const uint8_t LED_G = 17; static const uint8_t LED_B = 18; diff --git a/micropython/modules_py/interstate75.md b/micropython/modules_py/interstate75.md index 5d25b39e..3baf0666 100644 --- a/micropython/modules_py/interstate75.md +++ b/micropython/modules_py/interstate75.md @@ -27,7 +27,7 @@ DISPLAY_INTERSTATE75_192X64 DISPLAY_INTERSTATE75_256X64 ``` -You are able to set which version of the Interstate75 that you are using with the `interstate75w=` as default this value is set to `False` to use the Interstate75 button layout by setting it to `True` the module will use the Intersate75W button layout. If you are using an Interstate75W it is important to set this value to `interstate75w=True`, otherwise this could disable the wifi in your project. +You are able to set which version of the Interstate75 that you are using with the `interstate75w=`. By default this value is set to `True` to use the Interstate75W button layout. By setting it to `False` the module will use the Interstate75 button layout. If you are using an Interstate75W it is important to set this value to interstate75w=True, otherwise this could disable the WiFi in your project ```python import interstate75 @@ -44,7 +44,7 @@ import interstate75 display = interstate75.DISPLAY_INTERSTATE75_32X32 -board = interstate75.Interstate75(display=display, interstate75w=True) +board = interstate75.Interstate75(display=display, interstate75w=False) #This is th e setup to be able to access the both A and BOOT on the Interstate75 (non W) ``` From here, all features can be accessed by calling functions on `board`. In addition, when using Qwiic / Stemma QT devices, the I2C channel to use can be accessed with `board.i2c`. diff --git a/micropython/modules_py/interstate75.py b/micropython/modules_py/interstate75.py index 64cba9c3..2637377e 100644 --- a/micropython/modules_py/interstate75.py +++ b/micropython/modules_py/interstate75.py @@ -67,7 +67,7 @@ class Interstate75: def switch_pressed(self, switch): if switch < 0 or switch >= self.NUM_SWITCHES: - raise ValueError("switch out of range. Expected SWITCH_A (0), SWITCH_B (1) SWITCH_BOOT (2)") + raise ValueError("switch out of range. Expected SWITCH_A (0), SWITCH_B/BOOT (1)") return self.__switches[switch].is_pressed def set_led(self, r, g, b):