Programming for Sculptors

ARTS-A0407 – Digital Sculpture 3 (2cr)

Lecture 5, 23.1.2020

Today:

  • Examples
  • A bit about conditional statements and variables
  • Assignment 2

Examples: Kati Hyyppä

Hyyppä's Vimeo channel: https://vimeo.com/user29829839

and website: http://katihyyppa.com/

Examples: Eun Young Park

List of examples by Matti Niinimäki (https://learn.mansteri.com/en/c/efa/efa007/)

Controlling a servo with an Arduino 2

Let's code a program that starts a servo sequence when a button is clicked and stops the sequence on the next click.

#include <Servo.h>

int BUTTON_PIN = 2;
int SERVO_PIN = 9;
Servo myservo;

bool buttonClicked = false;
bool runServo = false;
unsigned int nextServoMovement = 0;

void setup() {
  Serial.begin(9600);
  myservo.attach(SERVO_PIN);
  pinMode(BUTTON_PIN, INPUT_PULLUP);
}

void loop() {
  bool buttonState = digitalRead(BUTTON_PIN);
  
  if ( buttonState == LOW && buttonClicked == false) {
    Serial.println("Button clicked");
    runServo = !runServo;
    buttonClicked = true;
  } else if (buttonState == HIGH) {
    buttonClicked = false;
  }

  if (runServo) {
    unsigned long now = millis();
    if (now > nextServoMovement) {
      myservo.write(random(180));
      nextServoMovement = now + 500;  
    }
  }
}

Assignment 2

Poem with movement, project ideas

Animating with movement

Movement as a character

Implement one element of a kinetic sound sculpture

Record motors with a contact mic

Assgnment 2

Let's start working today. Submit your work on Wednesday 29.1. after class. If your work is unfinished we can discuss if you should continue working on it on the final project.

 

Submission: Record a video, send a link to the video and a short description by email to otso.havanto@aalto.fi

 

 

Try to find an electronic battery operated device (for example a toy) for the circuit bending/toy hacking workshop on Thursday 30.1.

Made with Slides.com