Skip to content

Instantly share code, notes, and snippets.

View jeffnoko's full-sized avatar

Jeff Leonard jeffnoko

View GitHub Profile
@jeffnoko
jeffnoko / gist:8754a0e611c3d67a18fea872dd19a8ea
Created December 29, 2017 22:52
draw lines controlling direction with rotary encoder
#include<AccelStepper.h>
#include <MultiStepper.h>
#include <Servo.h>
#include <Rotary.h>
#include <Wire.h>
Servo servo1;
@jeffnoko
jeffnoko / BezierWithPots_Arduino
Last active January 10, 2018 17:00
Use pots to set a bezier curve in Processing and draw on xy machine
#include<AccelStepper.h>
#include <MultiStepper.h>
#include <Servo.h>
MultiStepper steppers;
AccelStepper stepper1(1, 2, 3);
AccelStepper stepper2(1, 10, 11);
AccelStepper stepper3(1, 5, 6);
int spiralRatioCount = 0;
@jeffnoko
jeffnoko / BezierWithPots_Processing
Created January 9, 2018 06:06
Use pots connected to Arduino to make a bezier curve in Processing
// Bezier curve to visualize for drawing on xy machine.
import processing.serial.*;
Serial myPort;
float a,b,c,d,e,f,g,h;
float aa,bb,cc,dd,ee,ff,gg,hh;
String val;
boolean firstContact = false;
int end = 10;
@jeffnoko
jeffnoko / modifier-key.pde
Created January 20, 2018 04:12
Processing: mouse click with modifier key.
void mouseClicked() {
if (modifierKey == 'c') {
println("C+mouse");
} else if (modifierKey == 's') {
println("S+mouse");
}
}
char modifierKey;
void keyPressed() {
@jeffnoko
jeffnoko / circleMask.pde
Created March 13, 2018 17:55
random points within a circle
import processing.serial.*;
Serial myPort;
int radius = 300;
float angle = 0;
float angleStep = .001;
float r,s,p,q;
int rLimit1;
int rLimit2;
@jeffnoko
jeffnoko / Random_Circle_Oval_Dots.pde
Created March 13, 2018 22:32
Circles and ovals made up of random placed dots random size and location
import processing.serial.*;
Serial myPort;
float radius1 = random(100, 300);
float radius2 = random(100, 300);
int count =0;
float pos1 = random(200, width -200);
float pos2 = random(200, height -200);
float A = random(500, 1500);
int counter = 0;
import processing.serial.*;
Serial myPort;
int counter = 0;
float x, y, t;
int count = 0;