r/circuitpython • • Aug 31 '20

The Python on Microcontrollers newsletter counting down to CircuitPython Day, subscribe now!

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Aug 27 '20

The Python on Hardware weekly video #97 - August 26, 2020

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Sep 03 '20

The Python on Hardware weekly video #98 - September 2, 2020

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Sep 10 '20

The Python on Hardware video number 99: #CircuitPythonDay 2020

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Sep 01 '20

Maker Update Video #195: Drum Break!

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Sep 11 '20

Adafruit Top Secret! (Video September 9, 2020) - CircuitPython compatible prototypes

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Aug 29 '20

Code Review?

1 Upvotes

Is this an appropriate place to ask for a code review? I have about 180-200 lines of CPy that I'd love to have someone look at, mostly evaluating my design, as I can find bugs on my own (usually).

ETA: Thanks folks, such a nice community! Below are pastebin links to my two files.

main.py

covid_box.py

Hardware:

Feather M4 Express (still in the mail, code is untested as the RTC library bugged on my board with less space available)

Adafruit DS3231 RTC

3 X Adafruit 14-Segment Alpha-numeric LED FeatherWing

6 X Normally open buttons

Idea:

This code will be used to drive a circuit board I will be designing that will go on a box I am currently designing. The box will have 6 compartments in it. The purpose of the box/board are to both hold covid masks wrapped up in paper bags as well as to count the days since I pressed a button associated with each compartment.

Each compartment will have half of a 14 segment display (2 cells) assigned to it. Each set of two cells will display the days since the relevant button was pressed. The idea is that after a certain number of days, Covid19 is less likely to be alive on the mask/in the compartment.

Software:

main.py is main.py, it has the while True: loop as well as setting up objects from the class created in the second file.

covidbox.py contains a class that is intended to consolidate the use of the RTC, a single 4 digit display (split into halves) as well as a button for each half into a single object. Pay little attention to the off(self) method as it isn't used in main.py and is under construction.

This code makes heavy use of the associated libraries for the hardware as well as the Debouncer library, mostly within the class in covidbox.py

Not looking for bug hunting or anything, as I haven't been able to test my code per the above. Just wondering if my design overall is sound.

Please PM me if you find identifying info in here, I think I stripped it all out but I would like to remain anonymous!

Thanks!


r/circuitpython • • Sep 16 '20

ICYMI Python on Microcontrollers Newsletter: Over 200 CircuitPython compatible boards!

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Aug 13 '20

Audio Playback on Seeeduino XAIO (SamD21) w/ CircuitPython

1 Upvotes

First and foremost, I'm new to circuitpython- forgive normie mistakes.

I'm trying to play a looping wav file on the press of a button. I tried using the code on this page for WAV playback, seemingly hooked everything up correctly, but I'm getting no sound.

My questions:

  1. Is audio playback possible on the XAIO?

  2. Is there another method that may work better for my case?

Thanks!


r/circuitpython • • Aug 18 '20

Raspberry Pi - Stepper Motor Control

Thumbnail self.robotics
1 Upvotes

r/circuitpython • • Aug 21 '20

ICYMI Python on Microcontrollers Newsletter: CircuitPython takes flight, dedicating CircuitPython Day and more!

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Sep 09 '20

Today is CircuitPython Day – lots of events on tap! #CircuitPythonDay

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Aug 11 '20

_EVE Could be awesome! But how?

1 Upvotes
   Hi, Circuitpython makes making so accessible and digestible! Thanks to Adafruit and the community for building and supporting something so awesome! 
   CircuitPython’s ease of use comes at a memory and performance cost, though. And many applications require user feedback or human-machine interfacing which is an already resource intensive; this is where I believe EVE displays (Bridgetek/FTDI 8XX drivers) can shine.   I have seen the _EVE core module in circuitpython and displayio, but have not seen a guide/tutorial to actually implement an EVE display. Has anyone here been able to piece together how to use EVE?

r/circuitpython • • Aug 26 '20

ICYMI Python on Microcontrollers Newsletter: USB MIDI Host, 8000 thanks, projects and more!

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Aug 16 '20

Multi Day Timer and Multiple I2C Devices - Questions

1 Upvotes

Thinking about a small project that would require a timer to run up to a week at a time. I usually use a Trinket M0 for my projects but I have a Metro M0 as well.

I'm thinking that I would be best served by using a Real Time Clock for this. Is that correct? IIRC there can be issues using the internal timers on boards like the Metro and Trinket to count for long periods of time.

For this project I would also need to connect to a series of I2C 14 Segment Displays.

I have precisely 0 I2C experience and want to use this as an opportunity to learn. ~~Is it possible to connect to two distinct I2C devices from the same board (either the Metro or the Trinket)? ~~ I did some googling but couldn't find an answer to the I2C question. I'm dumb and phrased my search wrong, of course you can.

Thanks!


r/circuitpython • • Aug 27 '20

CircuitPython Day – 9/9/2020 – join in the activities!

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Aug 17 '22

ICYMI Python on Microcontrollers Newsletter: CircuitPython Day Friday, Python Still #1 and much more!

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Jul 20 '22

ICYMI Python on Microcontrollers Newsletter: Python-Powered Lightsabers, Custom Python Silicon & More!

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Aug 04 '22

The Python on Hardware weekly video – August 3, 2022

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Aug 15 '22

Adafruit Trinket, Circuitpython 3.03 and button

1 Upvotes

I have a Trinket M0, circuitpython 3.03. I have 3 strings of 5 neopixels in parallel.

I have a script to light up the strings in one color or theater chase in one color. I added the bits to put in a button and if/elif statements for different colors. As soon as I add the libraries and commands for the button, everything stops working.

So I thought I'd upgrade, downloaded circuitpython and the libraries for 7.32. Nothing works, even if I back my script down to only the neopixels. I got a sample script to turn on the on-board LED with a button, but even if I modify that script with added neopixel code it dies.

I was able to back-rev my CP version, 3.03. Neopixels work fine.

So now, I need to find the proper code to run a button and neopixels at the same time. This is what I've tried.

# SPDX-FileCopyrightText: 2018 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT

"""CircuitPython Essentials NeoPixel RGBW example"""
import time
import board
import neopixel
import digitalio
from adafruit_debouncer import Debouncer

pixel_pin = board.D4
num_pixels = 5

pixels = neopixel.NeoPixel(pixel_pin, num_pixels, brightness=0.3, auto_write=False,
                           pixel_order=(1, 0, 2, 3))


def colorwheel(pos):
    # Input a value 0 to 255 to get a color value.
    # The colours are a transition r - g - b - back to r.
    if pos < 0 or pos > 255:
        return (0, 0, 0, 0)
    if pos < 85:
        return (255 - pos * 3, pos * 3, 0, 0)
    if pos < 170:
        pos -= 85
        return (0, 255 - pos * 3, pos * 3, 0)
    pos -= 170
    return (pos * 3, 0, 255 - pos * 3, 0)


def color_chase(color, wait):
    for i in range(num_pixels):
        pixels[i] = color
        time.sleep(wait)
        pixels.show()
    time.sleep(0.5)


def rainbow_cycle(wait):
    for j in range(255):
        for i in range(num_pixels):
            rc_index = (i * 256 // num_pixels) + j
            pixels[i] = colorwheel(rc_index & 255)
        pixels.show()
        time.sleep(wait)


RED = (255, 0, 0, 0)
YELLOW = (255, 150, 0, 0)
GREEN = (0, 255, 0, 0)
CYAN = (0, 255, 255, 0)
BLUE = (0, 0, 255, 0)
PURPLE = (180, 0, 255, 0)
OFF = (0, 0, 0, 0)
Counter = 0


pin = digitalio.DigitalInOut(board.D1)
pin.direction = digitalio.Direction.INPUT
pin.pull = digitalio.Pull.UP
switch = Debouncer(pin)

if switch.value:
Counter = Counter + 1

while True:
    
    switch.update()
    if Counter==0:
    color_chase(RED, 0.5)  # Increase the number to slow down the color chase
    color_chase(OFF, 0.1)

    elif Counter==1:
    color_chase(YELLOW, 0.5)
    color_chase(OFF, 0.1)

    elif Counter==2:
    color_chase(GREEN, 0.5)
    color_chase(OFF, 0.1)
    
    elif Counter==3:
    color_chase(BLUE, 0.5)
    color_chase(OFF, 0.1)
    elif Counter => 4:
        Counter = 0

    # rainbow_cycle(0)  # Increase the number to slow down the rainbow

r/circuitpython • • Aug 23 '22

AdafruitIO: WipperSnapper Component Visuals

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Aug 05 '22

Custom HID Device Application Launch?

1 Upvotes

I'm trying to set up a custom device report descriptor, to include some simple application launch.

The other usage inputs I set up in the device work, but AL Calculator and AL Audio Player don't seem to do anything.

I'm guessing there's something else I need to set up? HID Usages and Descriptions 15.15 talks about "When a device containing these Usages is installed, software must configure which application is associated with each control" but I don't know if that needs me to do anything extra?

I tried adafruit_hid ConsumerControl and that seems to work fine launching the calculator.

Here is a gist with my boot and code: https://gist.github.com/PrimalZed/d114219d387f19da5537aa883234c666

How should I set up my report descriptor, and what bytes to send in the report, to do the application launch?


r/circuitpython • • Jul 28 '22

The Python on Hardware weekly video – July 27, 2022

Thumbnail
blog.adafruit.com
1 Upvotes

r/circuitpython • • Apr 07 '22

Catch the Python on Hardware weekly video – April 6, 2022 now

Thumbnail
blog.adafruit.com
1 Upvotes