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
import mcp | |
import time | |
m = mcp.MCP23008(0x21, 0, 2) | |
m.output(7, True) # turn on backlight | |
def pulse_enable(): | |
enable = 2 | |
m.output(enable, False) | |
time.sleep_us(1) | |
m.output(enable, True) |
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
from lcd import initialize, puts, clear, set_pos | |
initialize() | |
puts('Ready...') | |
def get_climate_json(): | |
import socket | |
url = 'http://192.168.0.111/data.json' | |
_, _, host, path = url.split('/', 3) | |
addr = socket.getaddrinfo(host, 80)[0][-1] |
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
import subprocess | |
def send(cmd): | |
subprocess.run(['bash', '-c', "echo %s > /dev/cu.usbmodem142303" % cmd ]) | |
process = subprocess.run(['osascript', 'getZoomStatus.applescript'], stdout=subprocess.PIPE) | |
status = process.stdout.decode().split(',') | |
print(status) | |
state = {y[0]: y[1] for y in [x.split(':') for x in status]} |
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
# https://github.com/smitmartijn/streamdeck-zoom-plugin/blob/33892febdc188b2124b2a32c55b84ba3d2b5c949/Sources/MacOS.cpp#L66 | |
# run with `osascript` | |
set zoomStatus to "closed" | |
set muteStatus to "disabled" | |
set videoStatus to "disabled" | |
set shareStatus to "disabled" | |
set recordStatus to "disabled" | |
tell application "System Events" | |
if exists (window 1 of process "zoom.us") then |
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
// headphone mount that clips on my mic arm | |
//difference() { | |
//square(20, center=true); | |
//square(10, center=true); | |
//} |
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
\ from proposal http://www.forth200x.org/fvalue.html | |
variable %var | |
: to 1 %var ! ; | |
: fvalue create f, does> %var @ if f! else f@ then 0 %var ! ; | |
0e0 fvalue i3 | |
0e0 fvalue r3 | |
59 value x1 | |
21 value y1 |
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
# This file is executed on every boot (including wake-boot from deepsleep) | |
#import esp | |
#esp.osdebug(None) | |
import gc | |
import webrepl | |
webrepl.start() | |
gc.collect() |
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
import random | |
import time | |
import board | |
import simpleio | |
from adafruit_ht16k33.matrix import Matrix8x8 | |
import pwmio | |
import analogio | |
i2c = board.I2C() | |
matrix = Matrix8x8(i2c, auto_write=False) |
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
struct state { | |
int some_info; | |
void (*next)(struct state *s); | |
}; | |
void end(struct state *s) { | |
// do some clean up | |
s->some_info = 0; | |
s->next = halt; | |
} | |
void bar(struct state *s) { |
NewerOlder