-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from BlitzCityDIY/add_DS2482S-800
Add DS2482S-800 support
- Loading branch information
Showing
4 changed files
with
105 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2024 Liz Clark for Adafruit Industries | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
"""Adafruit DS2482S-800 8-Channel DS18B20 Example""" | ||
|
||
import time | ||
import board | ||
from adafruit_ds248x import Adafruit_DS248x | ||
|
||
# Initialize I2C bus and DS248x | ||
i2c = board.STEMMA_I2C() | ||
ds248x = Adafruit_DS248x(i2c) | ||
|
||
while True: | ||
for i in range(8): | ||
ds248x.channel = i | ||
print(f"Reading channel {ds248x.channel}") | ||
temperature = ds248x.ds18b20_temperature() | ||
print(f"Temperature: {temperature:.2f} °C") | ||
print() | ||
time.sleep(1) |