We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 118806a commit 5c59c04Copy full SHA for 5c59c04
Metro/Metro_RP2350_Chips_Challenge/definitions.py
@@ -18,16 +18,19 @@
18
launcher_config = json.load(f)
19
20
# Check if DAC is connected
21
-i2c = board.I2C()
22
-for i in range(500): # try for 5 seconds
23
- if i2c.try_lock():
24
- break
25
- time.sleep(0.01)
26
-if 0x18 in i2c.scan():
27
- ltv320_present = True
+if "I2C" in dir(board):
+ i2c = board.I2C()
+ for i in range(500): # try for 5 seconds
+ if i2c.try_lock():
+ break
+ time.sleep(0.01)
+ if 0x18 in i2c.scan():
28
+ ltv320_present = True
29
+ else:
30
+ ltv320_present = False
31
+ i2c.unlock()
32
else:
33
ltv320_present = False
-i2c.unlock()
34
35
if ltv320_present:
36
dac = adafruit_tlv320.TLV320DAC3100(i2c)
0 commit comments