Skip to content

Instantly share code, notes, and snippets.

View santolucito's full-sized avatar
🐢
Thinking Slow

Mark Santolucito santolucito

🐢
Thinking Slow
View GitHub Profile
"""
https://youtu.be/OCe36rvdrFI
"""
a = 0.0
def setup():
#size(640, 360, P3D)
fullScreen(P3D)
@santolucito
santolucito / readJoystickSwitch.pde
Created February 7, 2021 13:52
A simple pair of processing and arduino programs to send data back and forth
/**
* Simple Read
*
* Slightly Modified from the Serial Example provided through the Ardunio IDE
*
* Read data from the serial port and change the color of a rectangle
* when a switch connected to a Wiring or Arduino board is pressed and released.
* This example works with the Wiring / Arduino program that follows below.
*/
@santolucito
santolucito / sonicPiSerial.py
Created February 8, 2021 14:37
Sonic Pi + Python + ESP32
'''
this python code will listen for serial messages,
and pass that trigger on to SonicPi (code below) as an OSC message, triggering a sound
'''
from pythonosc import osc_message_builder
from pythonosc import udp_client
import serial
import sys
import time
@santolucito
santolucito / ESP32Send.ino
Last active November 8, 2024 10:34
Sending UDP on ESP32 in Station Mode
#include <WebServer.h>
#include <WiFi.h>
#include <WiFiUdp.h>
//set up to connect to an existing network (e.g. mobile hotspot from laptop that will run the python code)
const char* ssid = "ssid";
const char* password = "password";
WiFiUDP Udp;
unsigned int localUdpPort = 4210; // port to listen on
char incomingPacket[255]; // buffer for incoming packets
@santolucito
santolucito / ESP32_UDP_AP.ino
Last active April 21, 2023 20:06
Sending UDP on ESP32 in AP mode
#include <WebServer.h>
#include <WiFi.h>
#include <WiFiUdp.h>
// the IP of the machine to which you send msgs - this should be the correct IP in most cases (see note in python code)
#define CONSOLE_IP "192.168.1.2"
#define CONSOLE_PORT 4210
const char* ssid = "ESP32";
const char* password = "12345678";
WiFiUDP Udp;
@santolucito
santolucito / dht11_esp32.ino
Created March 22, 2021 14:00
DHT-11 w/ ESP32
// DHT Temperature & Humidity Sensor
// Unified Sensor Library Example
// REQUIRES the following Arduino libraries:
// - DHT Sensor Library: https://github.com/adafruit/DHT-sensor-library
// - Adafruit Unified Sensor Lib: https://github.com/adafruit/Adafruit_Sensor
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>
@santolucito
santolucito / idletime.py
Created July 24, 2021 20:43
Age of Empires 2 TC Idle time calculator
import os
from typing import ItemsView
from construct.core import Switch
from mgz import header, body
from pprint import pprint
tc_building_id = 0
total_time_until_castle_click = 0
@santolucito
santolucito / README
Last active October 14, 2021 20:41
Pressure sensor w/ Arduino + Processing
Video demo and explanation here: https://youtu.be/CYUlLaxY4Xs
@santolucito
santolucito / csvReader.maxpat
Created January 21, 2022 21:30
MaxMSP CSV Processor
{
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 8,
"minor" : 1,
"revision" : 11,
"architecture" : "x64",
"modernui" : 1
}
@santolucito
santolucito / reader.py
Last active February 22, 2022 00:38
ESP32 capacitive touch+ python
# this code will read the touch values from the ESP32 and echo them on the command line
# you could do something else more interesting with these values (e.g. visualize/sonify)
# pip install pyserial
import serial
# change the port as necessary by your OS
ser = serial.Serial('/dev/ttyS8', 115200)
while(True):