Skip to content

Instantly share code, notes, and snippets.

@lizzybrooks
lizzybrooks / code.py
Last active May 9, 2022 20:35 — forked from RajanRao12/code.py
Organic Light pattern with switch (doesn't work)
import time
import board
import neopixel
from digitalio import DigitalInOut, Direction, Pull
pixel_pin = board.D2
num_pixels = 12
switch = DigitalInOut(board.D3)
switch.direction = Direction.INPUT
@lizzybrooks
lizzybrooks / iterative-incomplete.py
Created February 4, 2020 15:56 — forked from 190n/iterative-incomplete.py
Binary to decimal conversion with Python
def binary_to_decimal_iterative(binary):
total = 0
for i in range(len(binary)):
if binary[i] == '1':
pass
return total
/*
Title: Marching Elephants
Imagined, Designed, and Programmed by: Carly Brown
Date: October 16, 2017
Description: Textile Design Project
*/
function setup() {
createCanvas(10000, 10000);
function setup() {
createCanvas(2000,2000);
background(0,0,0);
angleMode(DEGREES);
// brownhead();
peachhead();
// normalhead();
// smilingmouth();
@lizzybrooks
lizzybrooks / randomFunction.js
Created March 8, 2018 21:10 — forked from nataliefreed/randomFunction.js
Example of choosing a random function in P5
/*
Example of choosing a random function
Notice this program re-randomizes the row of shapes every time it's run!
*/
function setup() {
createCanvas(800, 400);
background(50);
//draw some shapes to test. These aren't randomized
//Modified from P5 example at: https://p5js.org/examples/dom-video-capture.html
var capture;
function setup() {
createCanvas(320, 240);
capture = createCapture(VIDEO);
capture.size(320, 240);
capture.hide();
//baby pic used in class example is by ms. brooks. cite url for pics found online
var img;
//preload will load before setup runs
function preload() {
//this relative file path starts in the same folder as your sketch.
//In other words, in this example, make a folder called images in the same
//folder as your sketch file (sketch.js) and then put the image file ("kittens.jpg")
//inside of that.
img = loadImage("images/jomy.jpg");
@lizzybrooks
lizzybrooks / everyColorFromArray.js
Last active February 26, 2018 20:43 — forked from nataliefreed/randomColorFromArray.js
Pick a random color from an array in P5
function setup() {
createCanvas(700, 400);
var listOfColors = [color('#aabf12'), color('#33ab12'), color('#165512'), color('#fe3fa2'), color('#a345cd')];
strokeWeight(100);
for(var i=0;i<listOfColors.length;i++) {
stroke(listOfColors[i]);
function setup() {
}
function draw() {
drawMouseCoordinates();
}
function drawMouseCoordinates() {
push();
@lizzybrooks
lizzybrooks / template.js
Last active October 23, 2018 17:04 — forked from nataliefreed/template.pde
project template
/*
Title:
Imagined, Designed, and Programmed by:
Date:
Description: