Skip to content

Instantly share code, notes, and snippets.

@soffer
soffer / gist:7350596
Created November 7, 2013 07:36
Servo Follow Focus
/*
Focus Pulling:Free Mode, Automatically triggered Rec Mode, IO Mode,Playback Mode.
Double Click Free Switch sets lens limits. pSwitch limit in, IOSwitch limit out.
In IO Mode:control the speed of Playback with the dial.
Adi Soffer
11.7.12
*/
@soffer
soffer / FF Receiver 22.1.13
Created March 7, 2013 17:20
Latest working sketch for the follow focus - receiver
// Movement of Optical encoder is translated to moving stepper
// THIS IS A WORKING VERSION 22.1.13
#include <AccelStepper.h>
//encoder/motor/driver setup
int easyDriverMicroSteps = 2;
int rotaryEncoderSteps = 75;
int motorStepsPerRev = 200;
@soffer
soffer / FF Sender 22.1.13
Last active December 14, 2015 15:39
Latest working sketch for the follow focus - sender
// Movement of Optical encoder is translated to moving stepper
// THIS IS A WORKING VERSION 22.1.13
#include <OneButton.h>
//these pins can not be changed 2/3 are special pins
@soffer
soffer / Receiver Code 19.912
Created September 19, 2012 18:54
Receiver Code 19.912
// Movement of Optical encoder is translated to moving stepper
#include <AccelStepper.h>
//encoder/motor/driver setup
int easyDriverMicroSteps = 2;
int rotaryEncoderSteps = 75;
int motorStepsPerRev = 200;
int MinPulseWidth = 50; //too low and the motor will stall, too high and it will slow it down
@soffer
soffer / Sender code 19.9.12
Created September 19, 2012 18:53
Sender code 19.9.12
#include <OneButton.h>
// Movement of Optical encoder is translated to moving stepper
//
//these pins can not be changed 2/3 are special pins
int encoderPin1 = 2;
int encoderPin2 = 3;
@soffer
soffer / Optical Encoder + Stepper Motor Receiver = wired version v1
Created September 16, 2012 16:34
Optical Encoder + Stepper Motor Receiver = wired version v1
// Movement of Optical encoder is translated to moving stepper
#include <AccelStepper.h>
//encoder/motor/driver setup
int easyDriverMicroSteps = 2;
int rotaryEncoderSteps = 75;
int motorStepsPerRev = 200;
int MinPulseWidth = 50; //too low and the motor will stall, too high and it will slow it down
@soffer
soffer / Optical Encoder + Stepper Motor Receiver = wired version v1
Created September 16, 2012 16:33
Optical Encoder + Stepper Motor Receiver = wired version v1
// Movement of Optical encoder is translated to moving stepper
#include <AccelStepper.h>
//encoder/motor/driver setup
int easyDriverMicroSteps = 2;
int rotaryEncoderSteps = 75;
int motorStepsPerRev = 200;
int MinPulseWidth = 50; //too low and the motor will stall, too high and it will slow it down
@soffer
soffer / Optical Encoder + Stepper Motor = wired version v1
Created September 16, 2012 16:31
Optical Encoder + Stepper Motor = wired version v1
#include <OneButton.h>
// Movement of Optical encoder is translated to moving stepper
//
//these pins can not be changed 2/3 are special pins
int encoderPin1 = 2;
int encoderPin2 = 3;
@soffer
soffer / gist:3622007
Created September 4, 2012 15:01
Wired Optical/Stepper Follow Focus
/********************************************************
* Optical Encoder + Stepper Motor = Smart Follow Focus *
* Realtime, Lens Calibration, Variable Speed *
* Adi Soffer 2.9.12 *
*******************************************************/
#include <AccelStepper.h>
#include <OneButton.h>
@soffer
soffer / gist:3608510
Created September 3, 2012 10:51
making progress 31.8.12
#include <AccelStepper.h>
#include <OneButton.h>
//encoder/motor/driver setup
int easyDriverMicroSteps = 1; //I think this is 4 or 8
int rotaryEncoderSteps = 75; //setps per rev on your encoder
int motorStepsPerRev = 200; //this is right - steps per rev on the motor
int MinPulseWidth = 50; //too low and the motor will stall, too high and it will slow it down
//Encoder pins (cannot be changed 2/3 are special pins)