Matthew Chiang
Created November 9, 2015

Homework 04 Drawing Machines

Drawing machines

Showcase (no instructions)16
Homework 04 Drawing Machines

Things used in this project

Hardware components

acrylic
×1
pens or highlighters
×3
stepper motor
×1

Hand tools and fabrication machines

Laser cutter (generic)
Laser cutter (generic)
3D Printer (generic)
3D Printer (generic)

Story

Read more

Schematics

Drawing Machine AI File

Laser cut files

Drawing Machine AI File

Laser cut files

Code

Stepper Motor Test

Java
// very simple stepper motor test program
// for L298 type 
// each input controls one output
//
// Change log
// Michael Shiloh 10/5/15 - created
// Michael Shiloh 10/12/15 - corrected for crossed wires
//
// Licensing:
// This program is in the public domain 
//
// for the stepper motors with wires
// coming directly out of the motor,
// connect the wires like this:
// grey: OUT1
// green: OUT2
// yellow: OUT3
// red: OUT4

// for the stepper motors with small
// plastic connectors on the side,
// connect the wires like this:
// red: OUT1
// grey: OUT2
// yellow: OUT3
// green: OUT4

// these four Arduino outputs connect to the 
// L298 inputs which correspond to the L298
// outputs attached to the motor wires as 
// above 
const int OUT1 = 4;
const int OUT2 = 5;
const int OUT3 = 6;
const int OUT4 = 7;

void setup()  {
  pinMode(OUT1, OUTPUT);
  pinMode(OUT2, OUTPUT);
  pinMode(OUT3, OUTPUT);
  pinMode(OUT4, OUTPUT);
}

void loop() {
    digitalWrite(OUT1, LOW);
    digitalWrite(OUT2, HIGH);
    digitalWrite(OUT3, LOW);
    digitalWrite(OUT4, HIGH);
    delay(100);
    
    digitalWrite(OUT1, LOW);
    digitalWrite(OUT2, HIGH);
    digitalWrite(OUT3, HIGH);
    digitalWrite(OUT4, LOW);
    delay(100);
    
    digitalWrite(OUT1, HIGH);
    digitalWrite(OUT2, LOW);
    digitalWrite(OUT3, HIGH);
    digitalWrite(OUT4, LOW);
    delay(100);
    
    digitalWrite(OUT1, HIGH);
    digitalWrite(OUT2, LOW);
    digitalWrite(OUT3, LOW);
    digitalWrite(OUT4, HIGH);
    delay(100);
}

Credits

Matthew Chiang

Matthew Chiang

16 projects • 9 followers

Comments