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
#!/bin/bash | |
# Save script as `dlist` at a location on your $PATH. | |
# Run `chmod +x /path/to/dlist` | |
# | |
# Connect a USB serial device, eg. a Raspberry Pi Pico, and then | |
# enter `dlist` at the command line. | |
# | |
# You should see something like: | |
# `/dev/cu.usbserial-01AB8E0B` |
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
#!/usr/bin/env python3 | |
# Requirements: | |
# pip install pyftdi | |
# pip install hid | |
# brew install hidapi | |
from os import environ | |
from pyftdi.usbtools import UsbTools | |
count = len(UsbTools.find_all([(0x0403, 0x6014)])) |
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
# Add to your `.zshrc` file or use the function's contents as a script. | |
# | |
# With the former, add the function, restart your terminal, connect | |
# a USB serial device, eg. a Raspberry Pi Pico, and then enter `dlist` | |
# at the command line. | |
# | |
# You should see something like this: | |
# `/dev/cu.usbserial-01AB8E0B` | |
# | |
# If you have only one device attached, you can include the function's |
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
#!/usr/bin/env python3 | |
""" | |
ps-convert 1.0.0 | |
================ | |
PicoSystem Sprite Converter | |
@authors Dan Malec, modified and named by Tony Smith | |
@copyright 2021 |
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
#!/bin/zsh | |
# | |
# makepico.zsh | |
# | |
# Create a baseline Raspberry Pi Pico C-language project | |
# | |
# @author Tony Smith | |
# @copyright 2021, Tony Smith | |
# @version 2.1.0 |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ "name": "Pico Debug", | |
"device": "RP2040", | |
"gdbPath": "arm-none-eabi-gdb", | |
"cwd": "${workspaceRoot}", | |
"executable": "${command:cmake.launchTargetPath}", | |
"request": "launch", | |
"type": "cortex-debug", |
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
#!/usr/bin/env python | |
# IMPORTS | |
import requests | |
from time import time | |
from threading import Timer | |
import inkyphat | |
from PIL import ImageFont | |
# GLOBALS |
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
#!/usr/bin/python | |
from picamera import PiCamera | |
from time import sleep | |
from subprocess import call | |
import os | |
import sys | |
# CONSTANTS | |
KEEP_FILES = 10 |
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
class TSL2561 { | |
static version = "1.0.0"; | |
// TSL2561 register values | |
static TSL2561_COMMAND_BIT = "\x80"; // Command register. Bit 7 must be 1 | |
static TSL2561_CONTROL_POWERON = "\x03"; // Power on setting | |
static TSL2561_CONTROL_POWEROFF = "\x00"; // Power off setting | |
static TSL2561_REGISTER_TIMING = "\x81"; // Access timing register |
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
class LCD { | |
// A Squirrel class to drive a 16 x 2 to 20 x 4 character LCD driven by a Hitachi HD44780 controller | |
// via an MCP23008 interface chip on an Adafruit I2C backpack [http://www.adafruit.com/product/292] | |
// Communicates with any imp I2C bus | |
// Written by Tony Smith (@smittytone) October 2014 | |
// Version 1.1 | |
static MCP23008_IODIR = "\x00"; | |
static MCP23008_GPIO = "\x09"; |
NewerOlder