Repost with minimal reproducible error: I’m building a basic daylight alarm clock out of a rp2040, RTC, and NeoPixel strip. I’m building the Class for Alarm (inherits from Clock, inherits from NeoPixel) objects that contain: Time to trigger(hour, minute, second), Function to trigger, and Args for the function being triggered. I have Alarm inherit from ..
I’m building a basic daylight alarm clock out of a rp2040, RTC, and NeoPixel strip. I’m building the Class for Alarm objects that contain: Time to trigger(hour, minute, second), Function to trigger, and Args for the function being triggered, this is the relevant slice of code: class Alarm(Clock): def __init__(self, time, trigger, *args): self.absolute_alarm = ..
Is there a function I patch so that I can use Mock Methods as return values for sensor data? What I am trying to do is write tests for sensor data I will be measuring with an Adafruit BMP280 sensor. I want to write tests that I can just run on my computer, so that ..
I have been struggling because of the library adafruit_servokit has been stopping me from assigning pins. When I try to do this: from adafruit_servokit import ServoKit # Servo library that works with Jetson import RPi.GPIO as GPIO # Part of PWM DC motor control GPIO.setmode(GPIO.BOARD) # Error here It returns an error saying this: Traceback ..
I’m writing Python code on one of the new TI-84 Python edition calculators. These use a version of CircuitPython with limited support for some quite basic features. This includes missing dictionary methods such as items() and values(). My original version of Dijkstra’s Algorithm is below, followed by a nearly complete version in TI-Python. I’m having ..
I am completely stuck trying to find a way to pull JSON data from two different data sources in the following script. I am trying to find a way to pull Stock and Crypto quotes and display it on my PyPortal. Since I can only find an API for one or the other, I’d like ..
I’m using a DHT22 temperature and humidity sensor with a Raspberry Pi Zero W V1.1 to log temperature and humidity. I use Python and Adafruit library (https://github.com/adafruit/Adafruit_CircuitPython_DHT) and even that I’m able to read the data, I get plenty of reading errors. Just as an example, this is a log of the errors reported in ..
I am programming ada fruit ring LED lights in python, I have setup a local network for a midi controller to read data into my Raspberry Pi 3 and send to the 3 Pi Zero W through web sockets. I am running into the issue where some of the functions I have that run on ..
I’m using the Adafruit CircuitPython library for BLE pulse oximeters (https://github.com/adafruit/Adafruit_CircuitPython_BLE_BerryMed_Pulse_Oximeter). I’m running in the example script provided, and want to make my own changes for my application. As apart of the debugging process (to see what data is being handled/processed), I added some print statements in the __init__.py file. However, no matter what, these ..
I am reading a bmp file 4 bytes at a time to gather colors from a .bmp file to create a palette. When I read the file, I get b’x8bxc3**x00J**x00′. If I open this file in a hex editor, the string of bytes is b’x8bxc3**x4a**x00. Now that specific byte breaks the program when I try ..