Skip to content

Instantly share code, notes, and snippets.

View hugs's full-sized avatar
🤖
Making robots

Jason Huggins hugs

🤖
Making robots
View GitHub Profile
@hugs
hugs / Touch.cpp
Created August 30, 2024 20:03 — forked from erictroebs/Touch.cpp
Arduino Micro (ATmega32U4) Ten Finger Touchscreen Example
#include "Touch.h"
#if defined(_USING_HID)
#define CONTACT_COUNT_MAXIMUM 10
#define REPORTID_TOUCH 0x04
#define LSB(v) ((v >> 8) & 0xff)
#define MSB(v) (v & 0xff)
@hugs
hugs / 1_valet-demo.py
Created August 30, 2024 17:41
Tapster Valet - Calculator Demo
# To run script and start an interactive session (REPL):
# $ python -i demo.py --host=http://localhost:5000
import cv2
import os
import sys
import shutil
import time
import json
import sys
@hugs
hugs / focus-test.py
Last active June 15, 2023 02:59
Test for disabling autofocus on an Arducam 16MP camera.
import cv2
cap = cv2.VideoCapture(0)
# You *must* grab at least frame before focus settings take effect.
# Try commenting and uncommenting the following line to test it
grabbed, frame = cap.read()
cap.set(cv2.CAP_PROP_AUTOFOCUS, 0)
cap.set(cv2.CAP_PROP_FOCUS, 460)
@hugs
hugs / 1_tapster_camera_setting_test.py
Last active June 15, 2023 20:14
Tapster 3 - Camera Setting Test.py
import os
import cv2
import time
# Set image resolution
# Option 1
#frame_width = 4656
#frame_height = 3496
@hugs
hugs / webserver.nim
Last active June 8, 2023 13:25
Minimal Viable Web Server in Nim
# Minimal Viable Web Server for Nim
# 1) Install Nim:
# https://nim-lang.org/install.html
# 2) To run, enter this in a terminal window:
# nim c -r webserver.nim
# 3) Press Control-C to quit / stop the server.
@hugs
hugs / arducam16.mjs
Created December 7, 2022 21:26
arducam16.mjs
// https://github.com/qweasd1/node-uvc-control (npm uvc-control2)
// Example
// import { Control } from './arducam16.mjs'
// var control = new Control({width: this.config.width, height: this.config.height})
// control.init()
import UVCControl from 'uvc-control2'
const defaults = {
@hugs
hugs / grbl-settings.txt
Created September 9, 2021 14:10
Grbl settings for Tapster 3
Grbl 1.1f ['$' for help]
$0=3
$1=255
$2=0
$3=0
$4=0
$5=1
$6=0
$10=1
$11=0.010
@hugs
hugs / tapster-3.coffee
Created October 1, 2020 00:23
Tapster 3 Assembly - It's okay to use CoffeeScript ☕😎
# Tapster 3 Assembly
# (c) 2020 Jason R. Huggins
# It's okay to use CoffeeScript ☕
# No, really, pi is wrong
Math.TAU = Math.PI*2
arm_offset = Math.acos(69.912/70) / Math.TAU * 360
servo_height_offset = (-28.5 / 2) - 5
servo_width_offset = 44.6 / 2
@hugs
hugs / Tapster-3-Demo.md
Last active June 8, 2023 14:36
Tapster 3 - Demo Script - Tap "Hello, World!!"
@hugs
hugs / harry-potter-hedwigs-theme.js
Created June 21, 2019 01:30
Tapster Sidekick Demo - Hedwig's Theme - Garage Band app
notes = {
'C': [54,130],
'D': [44,130],
'E': [34,130],
'F': [24,130],
'G': [16,130],
'A': [6,130],
'B': [-3,130],
'c': [-13,130],
'd': [-23,130],