Skip to content

Instantly share code, notes, and snippets.

View ulrichzwingli's full-sized avatar

ulrichzwingli

View GitHub Profile
@ulrichzwingli
ulrichzwingli / gist:2c94958570bc32488ec97ef8d1c9346e
Created October 7, 2017 21:38
3 Potentiometer Arduino Code
/*
*/
void setup() {
Serial.begin(9600);
pinMode(7,INPUT);
}
void loop() {
@ulrichzwingli
ulrichzwingli / gist:746a2933aef0fe929849619bb7ff5b2b
Created October 7, 2017 21:12
3 Potentiometer Arduino to P5 (P5 Sketch)
var serial; // variable to hold an instance of the serialport library
var portName = '/dev/cu.usbmodem1411'; // fill in your serial port name here
var inData;
var pot1;
var pot2;
var pot3;
//var circleColor = 255;
function setup() {
createCanvas(600, 400);
/*
*/
void setup() {
Serial.begin(9600);
pinMode(2,INPUT);
}
void loop() {
score = 0
denomination = 0
oddNumList=[] # declare an array
evenNumList=[]
firstHalfList=[]
secHalfList=[]
firstDozen=[]
secDozen=[]
thirdDozen=[]
row1=[]
@ulrichzwingli
ulrichzwingli / gist:0c29b15f358b9246123446bb44db79f8
Created October 2, 2017 17:38
Exploring Turtle : Random images
from turtle import *
import random
colors = ['orange', 'yellow', 'red', 'green', 'blue','cyan']
for n in range(50):
penup()
goto(random.randint(-400, 400), random.randint(-400, 400))
pendown()
distance = random.randint(10, 40)
score = 0
oddNumList=[] # declare an array
evenNumList=[]
firstHalfList=[]
secHalfList=[]
firstDozen=[]
secDozen=[]
thirdDozen=[]
row1=[]
row2=[]
int analog_range;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(8, OUTPUT);
pinMode(13, OUTPUT);
}
void loop() {
@ulrichzwingli
ulrichzwingli / gist:6760d2b63ac5467393e1e726a53aec1f
Created October 1, 2017 02:26
Potentiometer variable resistance lighting up LEDs
int analog_range;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(8, OUTPUT);
pinMode(13, OUTPUT);
}
void loop() {
@ulrichzwingli
ulrichzwingli / gist:06e8ef836aab7aaf921be73e9aaa992a
Created October 1, 2017 02:18
Physical computing : Combination Lock
/*
sketch to open a digital lock
*/
int attemptCount = 0;
int lastButtonState3 = 0;
int lastButtonState4 = 0;
int lastButtonState5 = 0;
int lastButtonState6 = 0;
int buttonState3;
int buttonState4;
@ulrichzwingli
ulrichzwingli / rollet.py
Created September 26, 2017 16:20
more of a Pseudo code for playing Beginners Rollet (with Limitations)
# allocating numbers to rollet categories
for rollet in range (36)
// initializing cell counts of categories to zero
rcc = 0, bcc = 0, ecc = 0, occ = 0, dz2c = 0, dz3c = 0, fh=0, sh=0, r1=0,r2=0,r3=0
if (rollet <=1 and rollet >= 10)
y = rollet % 2
if (y is 0):
bcc +=1, ecc +=1
black[bcc] = rollet
even[ecc] = rollet