Skip to content

Instantly share code, notes, and snippets.

@BenjaminSantiago
BenjaminSantiago / DES3090__timingGAME__annotated.py
Created November 27, 2023 18:33
(This is code for a simple "timing" game" with the CPX, that is heavily annotated)
'''
"TIMING GAME" annotated code
(by Benjamin Santiago for Bryan Rendon)
DES3090 --> FALL 2023
Hey y y y! So this is code from Fall 2022 (last year), and it was
for someone doing a similar idea to show them how the code
would be structured since it is kinda, radically different
than what we've done in class.
@BenjaminSantiago
BenjaminSantiago / DEZGO__code.js
Created October 25, 2023 19:52
scrapin' with image generator with text (dezgo) and node.js
/*
BENJAMIN SANTIAGO --> Will Rogers
(with some amended ChatGPT stuff)
So this will go to specifically, dezgo, and then, find a specific
textbox, click the "run" button, wait for the image, and then save
the image.
You'd have to modify this to do something like..
* choose (randomly?) from an array of prompts
@BenjaminSantiago
BenjaminSantiago / CPX_soundMETER__annotated.py
Created October 23, 2023 18:18
SOUND METER (Annotated)
#importz
#-----------------------------------------------------------------
import array
import math
import audiobusio
import board
from adafruit_circuitplayground.express import cpx
#-----------------------------------------------------------------
#functions
#paragraph_1
{
color: #FF0000;
}
#paragraph_2
{
color: #0000FF;
}
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div id = "everything">
<h1>
Welcome!
</h1>
@BenjaminSantiago
BenjaminSantiago / P5__DRAWINGwithSAVE.py
Created November 21, 2022 19:15
Our little drawing example but with the ability to save. Check your project folder to find the actual files.
drawing = False
def setup():
size(500,500)
background(240)
stroke(220,0, 220)
strokeWeight(20)
def draw():
@BenjaminSantiago
BenjaminSantiago / P5__IMAGEintro.py
Created November 21, 2022 19:08
simple image loading example
"""
image is from here:
https://www.pngkit.com/bigpic/u2w7q8t4r5u2w7w7/
Not sure the attribution
"""
size(500, 500)
#our PNG is transparent so this matters
background(255,0,255)
@BenjaminSantiago
BenjaminSantiago / P5xCPX__CPXside.py
Created November 21, 2022 18:59
our keyboard example combining Processing and the CPX; the CPX side
# our imports
# ------------------------------------------------------>
import usb_hid
"""
note that, this HID functionality is unique to the
circuit python express (there is an older "non-express"
version that is discontinued). Because of this we import
cpx, rather than cp.
"""
from adafruit_circuitplayground.express import cpx
@BenjaminSantiago
BenjaminSantiago / P5xCPX__PROCESSINGside.py
Created November 21, 2022 18:58
our keyboard example with the CPX and Processing; the Processing side
def setup():
background(255)
size(500,500)
def draw():
pass
def keyReleased():
if key == 'a' or key == 'A':
background(255,0,255)
@BenjaminSantiago
BenjaminSantiago / P5__DRAWINGwithERASURE.py
Created November 21, 2022 18:54
simple drawing example from before but with "e" key used for erasing
drawing = False
def setup():
size(500,500)
background(240)
stroke(220,0, 220)
strokeWeight(20)
def draw():