Skip to content

Commit 210777a

Browse files
committed
added examples
1 parent cea4a31 commit 210777a

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

examples/high_temp_alert_example.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import time
2+
import board
3+
import busio
4+
import adafruit_pct2075
5+
i2c = busio.I2C(board.SCL, board.SDA)
6+
7+
pct = adafruit_pct2075.PCT2075(i2c)
8+
pct.high_temperature_threshold = 35.5
9+
pct.temperature_hysteresis = 30.0
10+
pct.high_temp_active_low = False
11+
print("High temp alert active low? %s"%pct.high_temp_active_low)
12+
13+
# Attach an LED with the Cathode to the INT pin and Anode to 3.3V with a current limiting resistor
14+
15+
while True:
16+
print("Temperature: %.2f C"%pct.temperature)
17+
time.sleep(0.5)

examples/pct2075_simpletest.py

100644100755
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import time
2+
import board
3+
import busio
4+
import adafruit_pct2075
5+
i2c = busio.I2C(board.SCL, board.SDA)
6+
7+
pct = adafruit_pct2075.PCT2075(i2c)
8+
9+
while True:
10+
print(pct.temperature)
11+
time.sleep(0.5)

0 commit comments

Comments
 (0)