Skip to content

Instantly share code, notes, and snippets.

View mattytrentini's full-sized avatar

Matt Trentini mattytrentini

View GitHub Profile
//--------------------------------------------------------------------------------------------------
// hpp
#ifndef xml_helpers
#define xml_helpers
#include <xmlpp/libxml++.h>
#include "boost/tr1/memory.hpp"
namespace util
@mattytrentini
mattytrentini / gist:709266
Created November 21, 2010 23:13
CgiParameters
typedef CgiParameters map<string, string>;
CgiParameters test;
test["a"] = "1";
test["b"] = "fred";
test["c"] = "1.04";
@mattytrentini
mattytrentini / main.py
Created September 20, 2017 14:13
Micropython Asyncio example
import uasyncio as asyncio
from machine import Pin, PWM
from encoder import Encoder
from time import sleep_us, sleep_ms
button = Pin(14, Pin.IN, Pin.PULL_UP)
class LedStripController:
def __init__(self, enc, pwm):
@mattytrentini
mattytrentini / neopixel_simulator.py
Created July 29, 2018 04:20
neopixel_simulator.py
from itertools import chain
TOP = range(4)
TOP_LEFT = range(4,8)
TOP_RIGHT = range(8,12)
MIDDLE = range(12, 16)
BOTTOM_LEFT = range(16,20)
BOTTOM_RIGHT = range(20,24)
BOTTOM = range(24,28)
DOT = [29]
@mattytrentini
mattytrentini / circuitpython_2019.md
Last active January 8, 2019 10:32
CircuitPython 2019

CircuitPython 2019

In response to the request for feedback...an excellent idea by the way!

Improved compatibility with MicroPython

My main wish for CircuitPython in 2019 is to bring it closer in compatibility with MicroPython - or at least not to diverge further!

While they are clearly 'cousins' the two dialects differ enough that beginners are inevitably confused when trying to choose between the two - and are typically perplexed as to why there's any difference at all.

I understand why there's a difference but it seems greater than it needs to be. And the two communities could help each other out more rather than have a faint air of hostility.

@mattytrentini
mattytrentini / qr_wrapper.c
Created August 14, 2019 03:49
MicroPython C Module - Class Example to generate a QR Code
#include "py/obj.h"
#include "py/runtime.h"
#include "py/builtin.h"
#include "string.h"
#include "qrcodegen.h" // Project Nayuki C implementation
// This example models the following Python class:
// ----------------------------------------
// class QrCode:
@mattytrentini
mattytrentini / circuitpython_2020.md
Last active January 13, 2020 11:50
CircuitPython 2020

CircuitPython 2020

Once again, Adafruit have reached out to the community to request feedback for CircuitPython 2020.

I haven't been intimately involved with CircuitPython this year, instead focussing more heavily on MicroPython. Still, it's been exciting to watch the community grown and the platform develop and evolve.

Before we look forward, we should look back; let's review my CircuitPython 2019 feedback...

Retrospective

# modified by dpgeorge, works OK, needs a bit of tuning but it could be
# at the limit of the hardware
#
# This file is part of MicroPython MPU9250 driver
# Copyright (c) 2018 Mika Tuupola
# Copyright (c) 2018 0x1abin (added the yaw,picth,roll api and complementary filtering)
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
diff --git a/.gitmodules b/.gitmodules
index ceaa5342b..7a2fe6bb3 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -13,8 +13,8 @@
url = https://github.com/pfalcon/berkeley-db-1.xx
[submodule "lib/stm32lib"]
path = lib/stm32lib
- url = https://github.com/micropython/stm32lib
- branch = work-F4-1.13.1+F7-1.5.0+L4-1.3.0
diff --git a/ports/stm32/boards/NODE_151/mpconfigboard.h b/ports/stm32/boards/NODE_151/mpconfigboard.h
index 99ffc1f70..23358e9a9 100644
--- a/ports/stm32/boards/NODE_151/mpconfigboard.h
+++ b/ports/stm32/boards/NODE_151/mpconfigboard.h
@@ -5,7 +5,7 @@
#define MICROPY_HW_ENABLE_ADC (0)
#define MICROPY_HW_ENABLE_DMA (0)
#define MICROPY_HW_HAS_SWITCH (0) // Ought to be able to turn back on
-#define MICROPY_HW_HAS_FLASH (1)
+#define MICROPY_HW_HAS_FLASH (0)