Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Confluence
/
ZHdK Zoetrope

ZHdK Zoetrope

Jan 04, 2019

Analytics

Loading data...


Zoetrope parts files: 

Assembly files: 

Arduino code for those who are interested: 

/*
 * Arduino ATTINY85 code for the IAD ZHdK Zoetrope 
 * Author: Luke Franzke 
 * luke.franzke@zhdk.ch 
 * 2017
 * This example code is in the public domain.
 */

const int analogInPin = A2;  // Distance sensor
const int analogInPin2 = A3;  // Poti for motor
const int digOutPin = 1; // LED
const int pwmOutPin = 0; //Motor
const int ledTrigger = 280;
const int maxLedTime = 25; // maximum duration of led flash

int sensorValue = 0;   // value read from the distance sensor
int motorSpeed=0;
int lightCount = 0;
boolean trigerTag = false;

int flashTime = 1; //duration of flash

void setup() {
  pinMode(digOutPin, OUTPUT);
  pinMode(pwmOutPin, OUTPUT);
  pinMode(analogInPin, INPUT);
  pinMode(analogInPin2, INPUT);
}

void loop() {
  lightCount++;
  sensorValue = analogRead(analogInPin);

  if (sensorValue >= ledTrigger && trigerTag == true) {
    lightCount = 0;
    trigerTag = false;
  }
  // make sure the led can't be trigered again imediatly 
  if (sensorValue < ledTrigger && lightCount >= flashTime*2) {
    trigerTag = true;
  }
  if (lightCount >= flashTime) {
    digitalWrite(digOutPin, LOW);
  } else { 

    digitalWrite(digOutPin, HIGH);

  }
  motorSpeed = map(analogRead(analogInPin2), 0, 1024, 0, 255);
   // Flash duration is mapped to correlate to motor speed
  flashTime = floor(map(motorSpeed, 0, 255, maxLedTime, 1)); 
  
  if (motorSpeed>=30) {
  analogWrite(pwmOutPin, motorSpeed);
  }
  // reset lightcount
  if (lightCount >= 1000) {
    lightCount = flashTime * 2;
  }
}


Eagle files for electronics for those who are interested: 

ZoetropeZHdKEagle.zip




, multiple selections available,
For you

Digital Fabrication
Results will update as you type.
  • Digital Fabrication HS 2018
  • Digital Fabrication HS 2017
    • Lectures
    • ZHdK Zoetrope
    • Processing and Laser cutting
    • Project Briefs
    • Readings
    • Tools
    • Timetable
    • Software
  • Digital Fabrication HS 2019
  • Digital Fabrication HS 2020
  • Digital Fabrication HS 2021
  • Digital Fabrication HS 2022/23

{"serverDuration": 42, "requestCorrelationId": "9be624af6198476a9595e5bf5e152657"}