From dc90899afab8050335472305944ad5b29fa53c61 Mon Sep 17 00:00:00 2001 From: Liz Date: Wed, 20 Nov 2024 14:55:55 -0500 Subject: [PATCH 1/2] add metro esp32-s2 factory test --- .../code.py | 0 .../.feather_esp32s2.test.only | 0 .../Metro_ESP32S2_FactoryTest.ino | 33 +++++++++++++++++++ 3 files changed, 33 insertions(+) rename {TinyPod => BLE_Apple_Watch_Controller}/code.py (100%) create mode 100644 Factory_Tests/Metro_ESP32S2_FactoryTest/.feather_esp32s2.test.only create mode 100644 Factory_Tests/Metro_ESP32S2_FactoryTest/Metro_ESP32S2_FactoryTest.ino diff --git a/TinyPod/code.py b/BLE_Apple_Watch_Controller/code.py similarity index 100% rename from TinyPod/code.py rename to BLE_Apple_Watch_Controller/code.py diff --git a/Factory_Tests/Metro_ESP32S2_FactoryTest/.feather_esp32s2.test.only b/Factory_Tests/Metro_ESP32S2_FactoryTest/.feather_esp32s2.test.only new file mode 100644 index 000000000..e69de29bb diff --git a/Factory_Tests/Metro_ESP32S2_FactoryTest/Metro_ESP32S2_FactoryTest.ino b/Factory_Tests/Metro_ESP32S2_FactoryTest/Metro_ESP32S2_FactoryTest.ino new file mode 100644 index 000000000..fd9555a49 --- /dev/null +++ b/Factory_Tests/Metro_ESP32S2_FactoryTest/Metro_ESP32S2_FactoryTest.ino @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: 2022 Limor Fried for Adafruit Industries +// +// SPDX-License-Identifier: MIT + +#include +#include +#include "Adafruit_TestBed.h" + +extern Adafruit_TestBed TB; + +void setup() { + Serial.begin(115200); + // while (! Serial) delay(10); + + delay(100); + + TB.neopixelPin = PIN_NEOPIXEL; + TB.neopixelNum = 1; + TB.begin(); + TB.setColor(WHITE); +} + +uint8_t j = 0; + +void loop() { + + if (j % 10 == 0) { + TB.printI2CBusScan(); + } + TB.setColor(TB.Wheel(j++)); + delay(100); + return; +} From 2a2ff87d1da041c82d7e2f84b56ddf751bd2a64e Mon Sep 17 00:00:00 2001 From: Liz Date: Wed, 20 Nov 2024 15:08:18 -0500 Subject: [PATCH 2/2] Update code.py --- BLE_Apple_Watch_Controller/code.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/BLE_Apple_Watch_Controller/code.py b/BLE_Apple_Watch_Controller/code.py index 475b044fa..9b57bc199 100644 --- a/BLE_Apple_Watch_Controller/code.py +++ b/BLE_Apple_Watch_Controller/code.py @@ -85,14 +85,14 @@ # while BLE connected while ble.connected: position = encoder.position - # if the encoder is turned to the right - if position > last_position: - kbd.send(Keycode.RIGHT_ARROW) - # if the encoder is turned to the left - if position < last_position: - kbd.send(Keycode.LEFT_ARROW) - # reset encoder position if position != last_position: + # if the encoder is turned to the right + if position > last_position: + kbd.send(Keycode.RIGHT_ARROW) + # if the encoder is turned to the left + if position < last_position: + kbd.send(Keycode.LEFT_ARROW) + # reset encoder position last_position = position print(f"Position: {position}") for b in range(5):