Skip to content

Instantly share code, notes, and snippets.

View todbot's full-sized avatar
💭
doing the blink1

Tod Kurt todbot

💭
doing the blink1
View GitHub Profile

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:

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
@todbot
todbot / lsusb-verbose.js
Created April 22, 2017 06:02
lsusb for tessel node-usb based off schakko/node-usb lsusb.js example
// 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')
@todbot
todbot / electron-builder-appimage-bug.txt
Created October 11, 2017 22:56
Electron-builder appimage bug
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 / blink1-tool-chromebox.md
Last active April 2, 2018 20:37
Running blink1-tool on Asus CN62 Chromebox

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 / blink1-tool-custom-flashing.md
Last active April 24, 2018 08:49
Using blink1-tool to make a blink(1) customized flashing pattern

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 / hidapi-enum-tst.c
Last active November 16, 2020 22:55
hidapi list devices
// 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 / programming-tomu-efm32hg-with-stlinkv2-openocd.md
Last active September 6, 2023 18:54
Programming a Tomu EFM32HG with ST-Link V2 and OpenOCD
@todbot
todbot / raspi-node-hid.txt
Last active November 2, 2020 02:17
Installing node-hid on brand new Raspian on Raspberry Pi
# 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 / Teensy_USB_RawHID_Basic.ino
Created May 3, 2019 15:57
Just the contents of Examples/Teensy/USB_RawHID/Basic/Basic.pde, I couldn't find it on github
/* 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.