Skip to content

Instantly share code, notes, and snippets.

💭
waiting for Github Stories...

Tod E. Kurt todbot

💭
waiting for Github Stories...
Block or report user

Report or block todbot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@todbot
todbot / Teensy_USB_RawHID_Basic.ino
Created May 3, 2019
Just the contents of Examples/Teensy/USB_RawHID/Basic/Basic.pde, I couldn't find it on github
View Teensy_USB_RawHID_Basic.ino
/* Basic Raw HID Example
Teensy can send/receive 64 byte packets with a
dedicated program running on a PC or Mac.
You must select Raw HID from the "Tools > USB Type" menu
Optional: LEDs should be connected to pins 0-7,
and analog signals to the analog inputs.
This example code is in the public domain.
@todbot
todbot / raspi-node-hid.txt
Last active Jun 13, 2019
Installing node-hid on brand new Raspian on Raspberry Pi
View raspi-node-hid.txt
# What is our setup
pi@raspberrypi:~ $ cat /etc/debian_version
9.4
pi@raspberrypi:~ $ lsb_release --all
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.4 (stretch)
Release: 9.4
Codename: stretch
@todbot
todbot / programming-tomu-efm32hg-with-stlinkv2-openocd.md
Last active Nov 18, 2018
Programming a Tomu EFM32HG with ST-Link V2 and OpenOCD
View programming-tomu-efm32hg-with-stlinkv2-openocd.md
@todbot
todbot / hidapi-enum-tst.c
Last active Aug 21, 2018
hidapi list devices
View hidapi-enum-tst.c
// hidapi-enum-tst.c -- Demonstrate enumerating
//
// Build with: (assumes you have checked out 'hidapi' into a side directory)
// Mac:
// gcc -I ../hidapi/hidapi ../hidapi/mac/hid.c -framework IOKit -framework CoreFoundation hidapi-enum-tst.c -o hidapi-enum-tst
// Linux (hidraw):
// gcc -I ../hidapi/hidapi ../hidapi/linux/hid.c -ludev hidapi-enum-tst.c -o hidapi-enum-tst
// Linux (libusb):
// gcc -I ../hidapi/hidapi -I /usr/include/libusb-1.0 ../hidapi/libusb/hid.c -lpthread -lusb-1.0 hidapi-enum-tst.c -o hidapi-enum-tst
//
@todbot
todbot / blink1-tool-custom-flashing.md
Last active Apr 24, 2018
Using blink1-tool to make a blink(1) customized flashing pattern
View blink1-tool-custom-flashing.md

Create the pattern with a custom color:

This pattern has only two lines: a color and off.
The result if played on repeat is a flashing.

echo "making pattern"
blink1-tool -m 500 --rgb ff00ff --setpattline 0
blink1-tool -m 500 --rgb 000000 --setpattline 1

Try it out, make sure to only play those two lines

The --play commands takes three args: play/stop (1/0), start position, end position.

@todbot
todbot / blink1-tool-chromebox.md
Last active Apr 2, 2018
Running blink1-tool on Asus CN62 Chromebox
View blink1-tool-chromebox.md

Below are two ways to run blink1-tool to control blink(1) on a Chromebox via the command-line. To get a command-line, you need to enable developer mode on the Chromebox.

Method 1: Download pre-compiled blink1-tool for Linux

sudo mkdir -p /usr/local/bin
cd /usr/local/bin
curl -OL https://github.com/todbot/blink1/releases/download/v1.98a/blink1-tool-v1.98a-linux-x86_64.zip
sudo unzip blink1-tool*zip
sudo /usr/local/bin/blink1-tool --blink 3
@todbot
todbot / electron-builder-appimage-bug.txt
Created Oct 11, 2017
Electron-builder appimage bug
View electron-builder-appimage-bug.txt
todbot@vbubuntu:~/projects/tmp$ git clone https://github.com/todbot/electron-hid-toy
todbot@vbubuntu:~/projects/tmp$ cd electron-hid-toy
todbot@vbubuntu:~/projects/tmp/electron-hid-toy$ npm install
todbot@vbubuntu-blink1dev:~/projects/tmp/electron-hid-toy$ npm run build
> electron-hid-toy@0.1.5 build /home/todbot/projects/tmp/electron-hid-toy
> build
electron-builder 19.36.0
@todbot
todbot / lsusb-verbose.js
Created Apr 22, 2017
lsusb for tessel node-usb based off schakko/node-usb lsusb.js example
View lsusb-verbose.js
// lsusb-verbose.js
//
// Slightly fixed version of https://github.com/schakko/node-usb/blob/master/examples/lsusb/lsusb.js
// for https://github.com/tessel/node-usb
//
// Rework by Tod E. Kurt / todbot.com
//
var usb = require('usb')
View circuitpython-playing.txt
bokbokbok% bossac -i -p /dev/tty.usbmodem14121
Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v1.1 [Arduino:XYZ] Jan 17 2017 22:26:41
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
View keybase.md

Keybase proof

I hereby claim:

  • I am todbot on github.
  • I am todbot (https://keybase.io/todbot) on keybase.
  • I have a public key whose fingerprint is AAB5 37CE B4D8 4DC1 1571 D47E 74B1 4B82 CFFF 63C5

To claim this, I am signing this object:

You can’t perform that action at this time.