Drawing Machine: Rock

on

In fabricating a wooden rock out of a 12 IN x 12 IN block of poplar, a creature was born. Utilizing an Arduino UNO and a stepper motor driver along with a stepper motor and counter weight, movement was given to the rock allowing it to crawl along the ground. Graphite nubs imbedded within the outer layer of the rock allow it to “draw” on paper. The electronics are placed within a cement block and power is supplied to the rock through 16 gague wires and 1/4 IN audio jacks.

The code following directed the movement of the rock.

Code_
#define DIR_PIN 2
#define STEP_PIN 3
void setup() {
  pinMode(DIR_PIN,
OUTPUT);
  pinMode(STEP_PIN,
OUTPUT);
}
void loop(){
  rotateDeg(44, .13);
  delay(100);
}
void rotateDeg(float deg, float speed){
  int dir = (deg >
0)? HIGH:LOW;
 
digitalWrite(DIR_PIN,dir);
  int steps =
abs(deg)*(1/0.225);
  float usDelay =
(1/speed) * 113;
  for(int i=0; i <
steps; i++){
   
digitalWrite(STEP_PIN, HIGH);
   
delayMicroseconds(usDelay);
   
digitalWrite(STEP_PIN, LOW);
    delayMicroseconds(usDelay);
  }
}