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
@todbot
todbot / ACE128pintest-compiles
Created September 8, 2019 20:09
ACE128pintest-compiles
/* ACE PIN Serial Tester
IMPORTANT: for this to work you must uncomment "#define ACE128_ARDUINO_PINS" in ACE128.h
this displays the current position in all five forms on the serial monitor
pin = the raw gray-code from the pins. As you rotate this will rise and fall in steps
of 1,2,4,8,16,32,64 or 128
raw = the output from the encoder map table. This should rise from 0 - 127 as you rotate clockwise
if it jumps around and shows 255 a lot - your wiring does not match your encode map. Check your wiring
and your object declaration. See the make_encodermap example sketch to create encoder maps for
alternate pin arrangements
pos = this is the raw value converted to the range -64 - +63 relative to the logical zero. Logical zero is
@todbot
todbot / sketching19-talk-code-snippets.md
Last active September 28, 2019 02:51
sketching19-talk-code-snippets

here is a code snippet

commandline:

$ blink1-tool --millis 200 --rgb 255,0,255

C:

blink1_device* dev = blink1_open();
@todbot
todbot / arduino-poc-startup-error.txt
Created October 22, 2019 17:42
Arduino-PoC startup error
% cd /Applications/Arduino-PoC.app/Contents/MacOS
bok4bok:/Applications/Arduino-PoC.app/Contents/MacOS/% ls
Arduino-PoC*
bok4bok:/Applications/Arduino-PoC.app/Contents/MacOS/% ./Arduino-PoC
root INFO Theia app listening on http://localhost:60862.
daemon INFO >>> Starting 'arduino-cli' daemon... [/usr/local/bin/arduino-cli]
daemon INFO [INFO] Error: unknown shorthand flag: 'v' in -v
daemon INFO [INFO] Usage:
daemon INFO [INFO] arduino-cli daemon [flags]
daemon INFO [INFO]
@todbot
todbot / jep-big-screen.py
Created November 21, 2019 17:18
Make some big text for jep
# install pygame with "pip3 install pygame"
# run with "python3 jep-big-screen.py"
import pygame
swidth = 640
sheight = 480
fontname = "comicsansms"
message = "Hello John Park"
@todbot
todbot / midi_test_customname.ino
Created November 30, 2019 04:25
Adafuit TinyUSB MIDI test, using custom names
/*********************************************************************
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
MIT license, check LICENSE for more information
Copyright (c) 2019 Ha Thach for Adafruit Industries
All text above, and the splash screen below must be included in
any redistribution
*********************************************************************/
/*********************************************************************
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
MIT license, check LICENSE for more information
Copyright (c) 2019 Ha Thach for Adafruit Industries
All text above, and the splash screen below must be included in
any redistribution
*********************************************************************/
@todbot
todbot / test-teensy-rawhid-await.js
Created December 17, 2019 22:20
Demonstrate node-hid receiving data from Teensy RawHID device using event handlers and await()
//
// test-teensy-await.js -- demonstrate receiving data from Teensy RawHID device
// using event handlers and await()
// also demonstrates filtering on usagePage & usage
//
// For more details on RawHID, see: https://www.pjrc.com/teensy/rawhid.html
//
//
// Tod E. Kurt / github.com/todbot
//
@todbot
todbot / test-teensyrawhid-await2.js
Created December 18, 2019 01:22
node-hid await test again
//
// test-teensyrawhid-await2.js --
// node-hid await test again
// runnable. based on https://github.com/node-hid/node-hid/issues/358
//
var hid = require('node-hid');
let sleep = (milliseconds) => {
return new Promise(resolve => setTimeout(resolve, milliseconds))
@todbot
todbot / sercom_samd.ino
Created March 8, 2020 22:46
Create extra hardware serial ports on SAMD-based boards
/**
* Create extra hardware serial ports on SAMD21-based boards
* Verified on ItsyBitsy M0
* from:
* https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports?view=all#creating-a-new-serial
*
*
*/
#include <Arduino.h> // required before wiring_private.h
#include "wiring_private.h" // pinPeripheral() function
@todbot
todbot / USBH_MIDI_dump_msg_loss.ino
Created March 10, 2020 22:42
Demonstrate MIDI message loss by comparing received note-on vs note-off messages
/*
*******************************************************************************
* USB-MIDI dump utility
* Copyright (C) 2013-2017 Yuuichi Akagawa
*
* for use with USB Host Shield 2.0 from Circuitsathome.com
* https://github.com/felis/USB_Host_Shield_2.0
*
* This is sample program. Do not expect perfect behavior.
*******************************************************************************