You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im trying to display the Temp and humidity data using the sensors built in to the Clue, but i tried using the code bellow, but i get an error:
Traceback (most recent call last):
File "code.py", line 7, in
File "adafruit_clue.py", line 930, in
File "adafruit_clue.py", line 195, in init
ValueError: P5 in use
# Write your code here :-)
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import board
from adafruit_pybadger import pybadger
from adafruit_clue import clue
from adafruit_bmp280 import bmp280
temperature = clue.temperature
humidity = clue.humidity
pybadger.badge_background(
background_color=pybadger.YELLOW,
rectangle_color=pybadger.BLUE,
rectangle_drop=0.2,
rectangle_height=0.6,
)
pybadger.badge_line(
text="Stingers of Steel", color=pybadger.BLUE, scale=2, padding_above=2
)
pybadger.badge_line(text="Emerson C.", color=pybadger.YELLOW, scale=4, padding_above=4)
pybadger.badge_line(
text="Mentor / Mechanic", color=pybadger.YELLOW, scale=2, padding_above=2
)
pybadger.badge_line(
text="Temp: {:.1f} C".format(temperature), color=pybadger.YELLOW, scale=2, padding_above=2
)
pybadger.badge_line(
text="Humi: {:.1f} %".format(humidity), color=pybadger.YELLOW, scale=2, padding_above=2
)
pybadger.badge_line(
text="6642", color=pybadger.BLUE, scale=4, padding_above=10
)
display = board.DISPLAY
display.rotation = 180
pybadger.show_custom_badge()
while True:
if pybadger.button.a:
pybadger.show_qr_code("https://www.facebook.com/stingers6642")
pybadger.pixels.fill(pybadger.BLUE)
if pybadger.button.b:
pybadger.show_custom_badge()
pybadger.pixels.fill(pybadger.YELLOW)
The text was updated successfully, but these errors were encountered:
The PyBadge library will auto detect what board is being used and then import any additional libraries as needed.
The second import from the CLUE library is causing hardware that has already been initialized by the PyBadge library (via the first import) to try to be initialized a second time, but the hardware is already in use. That is what is causing the error.
Im trying to display the Temp and humidity data using the sensors built in to the Clue, but i tried using the code bellow, but i get an error:
Traceback (most recent call last):
File "code.py", line 7, in
File "adafruit_clue.py", line 930, in
File "adafruit_clue.py", line 195, in init
ValueError: P5 in use
The text was updated successfully, but these errors were encountered: