File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,6 @@ class RtkHandheld2Rev2 extends LightbugDevice:
22
22
static I2C-SDA := 0
23
23
static I2C-SCL := 1
24
24
constructor :
25
- super "RtkHandheld2 rev2" I2C-SDA I2C-SCL
26
- strobe -> Strobe :
27
- return NoStrobe // Probably didnt have a strobe, and probably doesnt matter
25
+ super "RtkHandheld2 rev2" I2C-SDA I2C-SCL --strobe = LegacyStrobe
28
26
messages-supported -> List :
29
27
return RtkHandheld2-MESSAGES
Original file line number Diff line number Diff line change @@ -24,6 +24,26 @@ class StandardStrobe implements Strobe:
24
24
available -> bool :
25
25
return true
26
26
27
+ set r / bool g / bool b / bool :
28
+ pinR .set ( if r : 1 else: 0 )
29
+ pinG .set ( if g : 1 else: 0 )
30
+ pinB .set ( if b : 1 else: 0 )
31
+
32
+ // Used on RH2 rev2 (only?)
33
+ class LegacyStrobe implements Strobe :
34
+
35
+ pinR / gpio.Pin
36
+ pinG / gpio.Pin
37
+ pinB / gpio.Pin
38
+
39
+ constructor :
40
+ pinR = gpio .Pin 18 --output = true
41
+ pinG = gpio .Pin 19 --output = true
42
+ pinB = gpio .Pin 20 --output = true
43
+
44
+ available -> bool :
45
+ return true
46
+
27
47
set r / bool g / bool b / bool :
28
48
pinR .set ( if r : 1 else: 0 )
29
49
pinG .set ( if g : 1 else: 0 )
You can’t perform that action at this time.
0 commit comments