Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Trentini mattytrentini

  • Melbourne, Australia
View GitHub Profile
View wip4.patch
diff --git a/ports/stm32/boards/NODE_151/mpconfigboard.h b/ports/stm32/boards/NODE_151/mpconfigboard.h
index a16a88e6e..f5344ca0d 100644
--- a/ports/stm32/boards/NODE_151/mpconfigboard.h
+++ b/ports/stm32/boards/NODE_151/mpconfigboard.h
@@ -1,8 +1,8 @@
#define MICROPY_HW_BOARD_NAME "Node151v2.2"
#define MICROPY_HW_MCU_NAME "STM32L151CCU"
-#define MICROPY_HW_UART_REPL PYB_UART_1
-#define MICROPY_HW_UART_REPL_BAUD 115200
View wip2.patch
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)
View stm32l1_micropython_wip.patch
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
View bala.py
# 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
View circuitpython_2020.md

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

@mattytrentini
mattytrentini / qr_wrapper.c
Created Aug 14, 2019
MicroPython C Module - Class Example to generate a QR Code
View qr_wrapper.c
#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:
View circuitpython_2019.md

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.

View 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 / main.py
Created Sep 20, 2017
Micropython Asyncio example
View main.py
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):
View gist:709266
typedef CgiParameters map<string, string>;
CgiParameters test;
test["a"] = "1";
test["b"] = "fred";
test["c"] = "1.04";