These are example files from the tutorial by @boneskull as seen on Get on The Good Foot with MicroPython on the ESP32, Part 2
View energy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- type: custom:apexcharts-card | |
graph_span: 23h | |
header: | |
show: true | |
title: Electriciteitsprijzen Vandaag (€/kwh) | |
span: | |
start: day | |
now: | |
show: true | |
label: Now |
View pixels.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright public licence and also I don't care. | |
# 2020 Josh "NeverCast" Lloyd. | |
from micropython import const | |
from esp32 import RMT | |
# The peripheral clock is 80MHz or 12.5 nanoseconds per clock. | |
# The smallest precision of timing requried for neopixels is | |
# 0.35us, but I've decided to go with 0.05 microseconds or | |
# 50 nanoseconds. 50 nanoseconds = 12.5 * 4 clocks. | |
# By dividing the 80MHz clock by 4 we get a clock every 50 nanoseconds. |
View 14201491-oled-TCA9548A
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Display - https://pmdway.com/collections/oled-displays/products/0-49-64-x-32-white-graphic-oled-i2c | |
// Guide - https://pmdway.com/blogs/product-guides-for-arduino/tutorial-using-the-0-49-64-x-32-graphic-i2c-oled-display-with-arduino | |
// TCA9548A - https://pmdway.com/blogs/product-guides-for-arduino/using-the-tca9548a-1-to-8-i2c-multiplexer-breakout-with-arduino | |
#include <Arduino.h> | |
#include <U8g2lib.h> | |
#include <Wire.h> | |
void TCA9548A(uint8_t bus) | |
{ |
View fetch-bin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async () => { | |
const response = await fetch('large.bin'); | |
const buffer = await response.arrayBuffer(); | |
}; |
View play.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Playback on USB audio device (the second soundcard's first device), | |
# with omxplayer: | |
# | |
# $ ./play.sh myfile.mp4 | |
# | |
# Use 'aplay -l' to list available devices, e.g: | |
# | |
# $ aplay -l | |
# card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio] | |
# Subdevices: 1/1 |
View cncjs-pendant-python-example.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inspired by cncjs-pendant-raspi-gpio: https://github.com/cncjs/cncjs-pendant-raspi-gpio | |
# This CNC.js pendant opens a connection to the CNC.js web server, opens a serial port connection, | |
# writes a command, then terminates. | |
import jwt | |
import logging | |
from socketIO_client import SocketIO, LoggingNamespace | |
SERVER_ADDRESS = "localhost" | |
SERVER_PORT = 8000 |
View ESP32_SSD1306_TCA_MULTIPLEXER.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Multiplexed SSD1306 Demo | |
* Copyright © 2018-01-02 tobozo | |
* | |
* https://github.com/tobozo | |
* https://twitter.com/tobozotagada | |
* | |
* 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 to |
View micropython i2c scanner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Scanner i2c en MicroPython | MicroPython i2c scanner | |
# Renvoi l'adresse en decimal et hexa de chaque device connecte sur le bus i2c | |
# Return decimal and hexa adress of each i2c device | |
# https://projetsdiy.fr - https://diyprojects.io (dec. 2017) | |
import machine | |
i2c = machine.I2C(scl=machine.Pin(5), sda=machine.Pin(4)) | |
print('Scan i2c bus...') | |
devices = i2c.scan() |
View IMfromsource.md
Install ImageMagick from source on Ubuntu 14.04
Note
These notes were for a job I am no longer at and are very dated. Please go to the imagemagick website for updated instructions.
The version of ImageMagick that is installed when you run apt-get install imagemagick
on Ubuntu 14.04 is older than I would like.
$ convert --version
NewerOlder