File tree Expand file tree Collapse file tree 3 files changed +40
-7
lines changed
BLE_Apple_Watch_Controller
Factory_Tests/Metro_ESP32S2_FactoryTest Expand file tree Collapse file tree 3 files changed +40
-7
lines changed Original file line number Diff line number Diff line change 85
85
# while BLE connected
86
86
while ble .connected :
87
87
position = encoder .position
88
- # if the encoder is turned to the right
89
- if position > last_position :
90
- kbd .send (Keycode .RIGHT_ARROW )
91
- # if the encoder is turned to the left
92
- if position < last_position :
93
- kbd .send (Keycode .LEFT_ARROW )
94
- # reset encoder position
95
88
if position != last_position :
89
+ # if the encoder is turned to the right
90
+ if position > last_position :
91
+ kbd .send (Keycode .RIGHT_ARROW )
92
+ # if the encoder is turned to the left
93
+ if position < last_position :
94
+ kbd .send (Keycode .LEFT_ARROW )
95
+ # reset encoder position
96
96
last_position = position
97
97
print (f"Position: { position } " )
98
98
for b in range (5 ):
Original file line number Diff line number Diff line change
1
+ // SPDX-FileCopyrightText: 2022 Limor Fried for Adafruit Industries
2
+ //
3
+ // SPDX-License-Identifier: MIT
4
+
5
+ #include < Arduino.h>
6
+ #include < Adafruit_NeoPixel.h>
7
+ #include " Adafruit_TestBed.h"
8
+
9
+ extern Adafruit_TestBed TB;
10
+
11
+ void setup () {
12
+ Serial.begin (115200 );
13
+ // while (! Serial) delay(10);
14
+
15
+ delay (100 );
16
+
17
+ TB.neopixelPin = PIN_NEOPIXEL;
18
+ TB.neopixelNum = 1 ;
19
+ TB.begin ();
20
+ TB.setColor (WHITE);
21
+ }
22
+
23
+ uint8_t j = 0 ;
24
+
25
+ void loop () {
26
+
27
+ if (j % 10 == 0 ) {
28
+ TB.printI2CBusScan ();
29
+ }
30
+ TB.setColor (TB.Wheel (j++));
31
+ delay (100 );
32
+ return ;
33
+ }
You can’t perform that action at this time.
0 commit comments