Skip to content

Instantly share code, notes, and snippets.

@sommersoft
sommersoft / gist:2334fc628cd2897a72f1672aad8f2cd1
Last active August 27, 2020 16:33
Overriding Methods With Composition
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython ce2754d50 on 2020-06-21; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board
>>> from frequencyio import FrequencyIn
>>> class NewFreqIn:
... def __init__(self, pin):
... self._freqin = FrequencyIn(pin) # composed base class as an attribute of NewFreqIn
...
... @property
... def capture_period(self):
@sommersoft
sommersoft / CircuitPython_2020.md
Last active January 6, 2020 03:44
sommersoft's #CircuitPython2020

2020: Year Of The Blinka (v3)

sommersoft’s Thoughts on CircuitPython in 2020

Its that time of year (the beginning) to call for the community’s thoughts on #CircuitPython2020. Here are my thoughts, and personal goals for 2020.

My 2019 In Review

Many of the submissions for last year’s #CircuitPython2019 included some introspective review of the things folks worked on in the previous year. I initially started with that format before the official call for 2020 went out. However, most of the submissions so far and the call itself are strictly forward-looking. Add to that the fact that my Year In Review got really long, I’ve decided to break it out from this and just link to it. It really only served as a personal stage-setter to advance my thoughts on the upcoming year. sommersoft’s CircuitPython 2019 Reflections

@sommersoft
sommersoft / CircuitPython_2019_Reflections.md
Last active January 6, 2020 03:53
sommersoft's CircuitPython 2019 Reflections

2019: What A Year For Our Patron Snake

sommersoft’s CircuitPython 2019 Reflections

My 2019 In Review

My contributions in 2019 fell largely into the “automation/tooling” category.

  • Adabot saw her capabilities and responsibilities grow quite a bit. She is now integral to the circuitpython.org website, providing daily library information updates to include open pull requests, open issues, and infrastructure issues. This allows a greater visibility of ways individuals can contribute, by providing a single-source of information. She also went through two host migrations: from travis-ci.org to travis-ci.com, and more recently from travis-ci.com to GitHub Actions. Outside of that, her updates were largely maintenance related, a lot of which were caused by my own mis-steps in maintenance ;-).
@sommersoft
sommersoft / rosie_log_4
Created June 21, 2019 03:47
Appified! (pretty-formatted here for readability)
(.env) ~/Dev/rosie_app/RosiePiApp/rosieapp:$> python3 run_rosiepi.py 3863a6ab8cffcc684ecb52adb361363503
{
"conclusion": "failure",
"completed_at": "2019-06-21T03:39:53Z",
"output": {
"title": "RosiePi",
"summary": "RosiePi\n=======\nCommit: [3863a](https://github.com/adafruit/circuitpython/commit/3863a6ab8cffcc684ecb52adb361363503)",
"text": "|Board|Result|Summary|\n|:---|:---:|:---|\n|metro_m4_express|failed|Initiating rosiepi...<br>
- Date/Time: 20-Jun-2019,22:39:52<br> - Test commit: 3863a6ab8cffcc684ecb52adb361363503<br>
- Test board: metro_m4_express<br>Connecting to: metro_m4_express<br>Connected!<br>Board info:<br>
@sommersoft
sommersoft / rosie_log_3
Created June 16, 2019 02:52
Verifier #5 Is Alive!
========================= RosiePi ==========================
Initiating rosiepi...
------------------------------------------------------------
- Date/Time: 15-Jun-2019,21:27:17
- Test commit: 6d388a34eb909e27acd508dc001ae1fe94a530de
- Test board: metro_m4_express
============================================================
Connecting to: metro_m4_express
------------------------------------------------------------
Connected!
@sommersoft
sommersoft / rosie_log_2
Last active June 11, 2019 04:47
RosiePi is now getting down to business...
Now running output and input tests through the raw repl!
========================= RosiePi ==========================
Initiating rosiepi...
------------------------------------------------------------
- Date/Time: 10-Jun-2019,23:39:25
- Test commit: cfe24b85322a029758c3376eed2726657397bf33
- Test board: metro_m4_express
============================================================
Connecting to: metro_m4_express
@sommersoft
sommersoft / rosie_log_1
Created June 6, 2019 04:51
Early log of RosiePi. Building and flashing firmware...test eval is next.
(.env) ~/Dev/rosie_pi/RosiePi:$> rosiepi metro_m4_express cfe24b85322a029758c3376eed2726657397bf33
========================= RosiePi ==========================
Initiating rosiepi...
------------------------------------------------------------
- Date/Time: 05-Jun-2019,23:46:42
- Test commit: cfe24b85322a029758c3376eed2726657397bf33
- Test board: metro_m4_express
============================================================
Connecting to: metro_m4_express
------------------------------------------------------------
@sommersoft
sommersoft / new_daily
Created April 30, 2019 14:26
Shortened daily report
(.env) ~/Dev/adabot/adabot:$> python3 -m adabot.circuitpython_libraries
Running CircuitPython Library checks...
Report Date: 30 April 2019, 09:13AM
- Depth for listing libraries with errors: 5
- Prompts for the GitHub Token are disabled.
Latest pylint is: 2.3.1
Found 161 repos to check.
Found 155 submodules in the bundle.
Running GitHub checks as sommersoft
@sommersoft
sommersoft / FrequencyIn_NVIC_Fail_Graceful
Created May 25, 2018 17:52
FrequencyIn_NVIC_Fail_Graceful
static uint8_t MAX_FREQUENCY = CONF_CPU_FREQUENCY / 512000;
void frequencyin_interrupt_handler(uint8_t index) {
Tc* tc = tc_insts[index];
if (!tc->COUNT16.INTFLAG.bit.MC0) return; // false trigger
pulseio_frequencyin_obj_t* self = active_frequencyins[index];
// since we use EVACT.PPW, the Period is put into the CC[0] register
// and that's all we need. CC[1] will contain the Pulse Width.
@sommersoft
sommersoft / FrequencyIn_MK134
Last active May 20, 2018 17:56
FrequencyIn_MK134
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Michael Schroeder
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights