This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// w for Fwd | |
// | |
// A simple Teensy based USB keyboard that associats some kind of | |
// physical motion event to a 'w' press. This can be used to advance Google StreetView | |
// for an interactive exercise experience (Example here: https://www.instagram.com/p/CF-xVWgJiFK/) | |
// | |
// Must select the "SERIAL+KEYBOARD..." mode under "USB TYPE" for the Teensy! | |
// | |
// This version uses a Sharp IR sensor (or equivalent), connected to A9 pin of a Teensy 3.2 | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import os.path | |
from googleapiclient.discovery import build | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from google.auth.transport.requests import Request | |
from google.oauth2.credentials import Credentials | |
from datetime import datetime | |
from random import randint | |
from time import sleep | |
from sds011 import SDS011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sds011 import SDS011 | |
from datetime import datetime | |
import time | |
#CH340G adapters seem to give port names | |
#based on which port you plug them into: | |
s1 = SDS011("/dev/tty.wchusbserial1410") #Left USB Port | |
s2 = SDS011("/dev/tty.wchusbserial1420") #Right USB Port | |
def read_sensor(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Parametric Bellow designed for blowing out grinds in an espresso grinder | |
// Designed to be printed using TPU | |
// Tested on Ender 3 Pro (2019) with stock extruder and 91A TPU from filaments.ca | |
// 15mm all speeds 2mm retraction @ 15mm/s. 75C bed 230/227C extruder temps | |
// 3 shell perimeter | |
// | |
// johntywang@gmail.com | |
// May 2021, Released under CC BY-SA 2.0 (http://creativecommons.org/licenses/by-sa/2.0/) | |
echo(version=version()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"boxes" : [ { | |
"box" : { | |
"maxclass" : "comment", | |
"text" : "Autosave and query of current file size", | |
"linecount" : 2, | |
"numoutlets" : 0, | |
"id" : "obj-38", | |
"patching_rect" : [ 568.0, 191.5, 150.0, 34.0 ], | |
"style" : "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request #talks to an ESP32 running this code: https://github.com/johnty/BBQProbe/tree/main/thermocouple_esp32 | |
contents = urllib.request.urlopen("http://192.168.1.65").read().decode() #find IP address and put it here... | |
f_string = contents.split("/")[2] #first / is for </head>, second / is between the C and F readings ;) | |
f_vals = f_string.split(); # split again based on spaces, result should be the F value string only. | |
print(f_vals[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint8_t midiPacket[15] = { | |
0b10000000, // header | |
0b10000000, // timestamp, not implemented | |
0b00000000, // status byte | |
21, | |
midi.mapMIDI(abs(imu.getAccelX()), 0, 50));// CC 021 (0b00010101) (for X-axis accelerometer) | |
22, | |
midi.mapMIDI(abs(imu.getAccelY()), 0, 50));// CC 022 (0b00010110) (for Y-axis accelerometer) | |
23, | |
midi.mapMIDI(abs(imu.getAccelZ()), 0, 50));// CC 023 (0b00010111) (for Z-axis accelerometer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while : | |
do | |
echo update at $(date) | |
echo `date` >> logdata.txt | |
curl -m 10 -s 192.168.1.96 | cut -d'/' -f3 | cut -d'<' -f1 >> logdata.txt | |
sleep 60 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Runtime.InteropServices; | |
public class HelloWorld | |
{ | |
//[DllImport("example")] | |
//public static extern int add(int a, int b); | |
[DllImport("mapper", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Trigger tester: | |
// use with eso32 lolin d32 pro, but can be adapted for any other | |
// emits T0 for pin 12 | |
// emits T1 for pin 13 at slightly increasing delays of 100ms | |
// emits T2 for pin 14 at slightly decreasing delays of 100ms | |
#define PIN_T0 12 | |
#define PIN_T1 13 |
NewerOlder