Skip to content

Instantly share code, notes, and snippets.

View brysonian's full-sized avatar

Chandler McWilliams brysonian

View GitHub Profile
@brysonian
brysonian / Plotter.pde
Last active November 7, 2019 22:09
ProcessingPlotterTest
import processing.serial.*;
class Plotter
{
Serial port;
int paperWidth;
boolean automap = false;
Plotter(PApplet p, int _paperWidth) {
this(p);
@brysonian
brysonian / cointoss.ino
Created October 21, 2019 17:24
Simple Sketch to Randomly Choose LEDs
const int BUTTON_PIN = 9;
const int LED_PIN = 13;
const int LED2_PIN = 10;
int state = 0;
int lastVal = 0;
int ledState = LOW;
int led2State = LOW;
@brysonian
brysonian / Thing.js
Last active May 8, 2019 03:40
Thinking about an alternate API for p5.js's "instance mode"
import {
rect,
fill,
} from './p5';
export default class Thing {
x = 0;
y = 0;
speed = 0;
@brysonian
brysonian / notes.h
Created January 31, 2019 21:25
List of note frequencies for arduino
#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_FS1 46
#define NOTE_G1 49
#define NOTE_GS1 52
const int BUTTON_PIN = 9;
const int LED_PIN = 13;
int state = 0;
int oldVal = 0;
int val = 0;
void setup() {
pinMode(LED_PIN, OUTPUT);
pinMode(BUTTON_PIN, INPUT_PULLUP);
@brysonian
brysonian / README.md
Last active May 19, 2018 04:54
create-boilerplate

To create a new project run:

npx https://gist.github.com/brysonian/0a5a29b76cd58b983fb75abbe90e0b2c {PROJECT_NAME}
yarn

To run a dev server: yarn start

/*
* Trinket M0 + 74HC165 Shift Register Internet Keyboard
* Uses: https://github.com/InfectedBytes/ArduinoShiftIn for the shift register
*
* Created: Apr, 2018
*
*/
#include <ShiftIn.h>
#include "Keyboard.h"
@brysonian
brysonian / test.jsx
Last active April 27, 2018 05:24
ApiConnector Render Prop
<ApiConnector id={id} get={`${API_BASE}/news`}>
{
(data, onSave, onDelete) => (
<Fiore>
<Form className="post-form full-width" onSave={onSave} onDelete={onDelete}>
<Group className="form-wrapper">
<Line label="Title" content={data.title} />
<Line label="Year" content={data.year} />
<Line label="Link" content={data.link} placeholder="http://" formatter={httpify} />
</Group>
@brysonian
brysonian / index.js
Created March 8, 2018 17:30
p5 x es6 scope test
class Sketch {
_fillColor = [0, 0, 0, 255];
_width = 200;
_height = 200;
setup() {}
draw() {}
createCanvas = (width, height) => {
@brysonian
brysonian / sketch.js
Created March 8, 2018 04:04
p5 x Classes sketch
class Foo extends p5.Sketch {
setup() {
this.createCanvas(400, 3000);
}
draw() {
const { fill, rect } = this;
fill(255);
rect(0, 0, 100, 100);
}