Skip to content

Instantly share code, notes, and snippets.

View tjpeden's full-sized avatar

TJ Peden tjpeden

View GitHub Profile
@tjpeden
tjpeden / example.ino
Last active May 11, 2020 03:01
Pot driven relay toggle
// This is a global variable
const int relay1 = 7; // let's call pin 7 relay1
// This is the setup function which gets run once, when the MCU gets reset
void setup() {
pinMode(relay1, OUTPUT); // set pin 7 to an output pin
digitalWrite(relay1, HIGH); // set pin 7 high
}
// This is the loop function which gets called repeatedly forever
@tjpeden
tjpeden / example.ino
Last active May 11, 2020 02:55
Relay toggle
// This is a global variable
const int relay1 = 7; // let's call pin 7 relay1
// This is the setup function which gets run once, when the MCU gets reset
void setup() {
pinMode(relay1, OUTPUT); // set pin 7 to an output pin
digitalWrite(relay1, HIGH); // set pin 7 high
}
// This is the loop function which gets called repeatedly forever
@tjpeden
tjpeden / code.py
Created April 2, 2019 05:53
Tinkering with CircuitPython and displayio
import time
from rtc import set_time_source
from board import SPI, RX, TX, D9, D10
from busio import UART
from displayio import FourWire, Group, release_displays
from adafruit_gps import GPS
from adafruit_ili9341 import ILI9341
@tjpeden
tjpeden / README.md
Last active March 21, 2019 04:11
Displaying GPS FeatherWing data on an OLED FeatherWing

The Problem

No GPS messages are processed when doing full or partial fill on the screen.

When line 53 is commented out GPS messages are processed as normal and data on the screen updates, albeit unreadable. If line 53 is uncommented GPS messages stop being processed after the first second. This is demonstrated by passing debug=True in the GPS constructor and viewing the serial monitor in Mu. GPS messages stop showing up in the serial monitor after the first second.

The screen is still being updated, boxes can be drawn, etc but messages from the GPS do not flow thus the

@tjpeden
tjpeden / code.py
Created January 13, 2019 21:11
My journey with CircuitPython on the Feather M4 Express with the 2.4" TFT FeatherWing
from board import SCK, MOSI, MISO, D5, D6, D9, D10
from busio import SPI
from digitalio import DigitalInOut
import storage
from storage import VfsFat
from adafruit_sdcard import SDCard
from adafruit_stmpe610 import Adafruit_STMPE610_SPI
from adafruit_rgb_display import color565

Keybase proof

I hereby claim:

  • I am tjpeden on github.
  • I am tangojuliett (https://keybase.io/tangojuliett) on keybase.
  • I have a public key ASBntzxsZFfKScJS14XWsxNjwFwR0SjiskhiEgvpGicD5go

To claim this, I am signing this object:

@tjpeden
tjpeden / README.md
Last active April 25, 2017 19:15
Reproducing Parallels Shared Drive Issue

Problem

Cannot access shared drives (i.e. "Home on Mac") when running applications (i.e. Visual Studio Express 2015) as Administrator. I can see them while running applications normally.

Info

  • MacBook Pro 2016 (macOS Sierra)
  • Parallels Desktop 12 Pro
  • Windows 10 Pro (Version 1703)
@tjpeden
tjpeden / test.zsh
Created April 15, 2016 19:46
Playing around with some ZSH scripts
colorize() {
case $1 in
none)
str="\e[0m";;
boldred)
str="\e[1;31m";;
boldgreen)
str="\e[1;32m";;
yellow)
str="\e[1;33m";;
@tjpeden
tjpeden / _c
Last active April 13, 2016 18:37
#conpdef c
#autoload
_files -W $CODE -/
@tjpeden
tjpeden / settings.json
Created March 28, 2016 14:48
VS Code settings
// Place your settings in this file to overwrite the default settings
{
"editor.fontSize": 14,
"editor.tabSize": 4,
"editor.renderWhitespace": true,
"files.trimTrailingWhitespace": true,
"files.autoSave": "off",
"rust.racerPath": "C:\\Users\\PedenT\\.cargo\\bin\\racer.exe",
"rust.rustLangSrcPath": "C:\\Users\\PedenT\\Documents\\code\\rustc-1.7.0\\src",
"rust.rustfmtPath": "C:\\Users\\PedenT\\.cargo\\bin\\rustfmt.exe",