|
Serial Box; actuated
metamorphic box that serializes it's space through constant
reconfiguration of local as informed by linear cellular automata
algorithms. |
|
/*
Serial Box; Arduino_Code
Nathan Wade
DX472
02.01.08
*/
int motorPin1 = 4;
int motorPin2 = 5;
int motorPin3 = 6;
int motorPin4 = 7;
int speed = 100;
int counter = 0;
int steps = 0;
int position = 0;
int step1array[4] = {
1, 0, 0, 1};
int step2array[4] = {
0, 1, 1, 0};
int step3array[4] = {
1, 1, 0, 0};
int step4array[4] = {
0, 0, 1, 1};
int go = 1;
int clocksteps;
int widsteps;
//step tuning
int stp_metronome0 = 200;
int stp_metronome1 = 500;
int stp_beep = 0; //loud beep
int stp_hum = 1; //loud hum
int stp_fast = 2; //quite turn
int stp_med = 3; //quite turn
int stp_slow = 4; //louder turn
int stp_sub_low = 20; //louder turn
int stp_micro_low = 50; //louder turn
int stp_btmfloor = 150;
int count = 0;
//ac vals
int ac_low = 2;
int ac_med = 15;
int ac_medhigh = 30;
int ac_high = 50;
//processing output
//int pxCA[1463]= {255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 74, 255, 255, 74, 255, 74, 255, 255, 74, 255, 74, 255,
255, 74, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 0, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 74, 255, 255, 74, 255,
255, 255, 74, 255, 255, 74, 255, 255, 255, 74, 255, 255, 74, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 74, 255, 255,
74, 255, 255, 255, 74, 255, 255, 74, 255, 255, 255, 74, 255, 255, 74,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 74, 255, 255, 74, 255, 74, 255, 255, 74,
255, 74, 255, 255, 74, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 74, 255, 255, 74, 255, 74, 255, 255, 74, 255, 74, 255, 255, 74,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 74, 255, 255, 74,
255, 74, 255, 255, 74, 255, 74, 255, 255, 74, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 74, 255, 255, 74, 255, 74, 255, 255, 74, 255,
74, 255, 255, 74, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 74,
255, 255, 74, 255, 74, 255, 255, 74, 255, 74, 255, 255, 74, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 74, 255, 255, 74, 255, 74, 255,
255, 74, 255, 74, 255, 255, 74, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 74, 255,
255, 74, 255, 74, 255, 255, 74, 255, 74, 255, 255, 74, 255, 255, 255,
255, 74, 255, 255, 74, 255, 74, 255, 255, 74, 255, 74, 255, 255, 74,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
74, 0, 74, 255, 0, 74, 74, 255, 255, 255, 255, 255, 74, 255, 255, 0,
255, 74, 255, 255, 74, 255, 74, 255, 255, 255, 74, 74, 255, 0, 74, 255,
255, 255, 74, 255, 255, 74, 255, 255, 74, 255, 255, 74, 255, 74, 255,
255, 74, 255, 0, 255, 255, 74, 255, 74, 255, 255, 255, 74, 0, 255, 74,
74, 255, 255, 255, 255, 255, 74, 255, 255, 255, 0, 255, 74, 74, 74,
255, 74, 255, 74, 74, 255, 74, 255, 255, 255, 255, 74, 255, 74, 255,
74, 255, 255, 255, 74, 255, 255, 74, 255, 255, 255, 74, 255, 255, 74,
74, 255, 255, 74, 255, 255, 255, 74, 255, 255, 74, 255, 255, 255, 74,
255, 255, 74, 74, 255, 255, 74, 255, 255, 255, 74, 255, 255, 74, 255,
255, 255, 74, 255, 255, 74, 255, 255, 255, 255, 255, 255, 255, 255, 74,
255, 255, 74, 255, 74, 255, 255, 74, 255, 74, 255, 255, 74, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 74,
255, 74, 255, 255, 255, 74, 255, 255, 74, 255, 74, 255, 255, 255, 255,
255, 255, 74, 255, 255, 255, 255, 0, 255, 74, 74, 255, 255, 74, 255,
74, 74, 255, 255, 74, 255, 0, 255, 255, 74, 255, 74, 255, 255, 74, 255,
74, 255, 74, 255, 74, 74, 255, 74, 255, 255, 255, 74, 255, 255, 255,
74, 255, 74, 255, 255, 255, 74, 255, 255, 74, 255, 255, 74, 255, 255,
74, 74, 255, 255, 74, 255, 74, 255, 255, 255, 255, 255, 255, 255, 74,
255, 74, 74, 255, 74, 255, 255, 255, 74, 255, 0, 255, 255, 255, 255,
74, 255, 255, 74, 255, 74, 255, 255, 74, 255, 74, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 74, 255, 74, 74, 255, 74, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 74, 255, 74, 74, 255, 74, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 74, 255, 74, 74, 255, 74, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 74, 255, 74, 74, 255,
74, 255, 255, 255, 74, 255, 255, 255, 74, 255, 74, 74, 255, 255, 255,
74, 74, 255, 255, 74, 255, 74, 74, 255, 74, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 74, 255, 74, 74, 255, 74, 255, 255, 255, 255,
255, 255, 255, 255, 74, 255, 74, 74, 255, 74, 255, 255, 255, 255, 0,
255, 74, 74, 255, 255, 74, 255, 255, 255, 74, 74, 255, 255, 74, 255,
74, 74, 255, 255, 74, 255, 74, 255, 255, 255, 255, 255, 255, 74, 255,
255, 255, 255, 0, 0, 0, 74, 255, 255, 255, 255, 255, 255, 74, 74, 255,
255, 74, 255, 74, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 0, 74, 255, 255, 255,
255, 255, 74, 74, 255, 74, 255, 255, 255, 74, 255, 74, 255, 255, 74,
255, 74, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 74, 255, 74, 255, 74, 255, 74, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 74, 255, 74, 74, 255, 74, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 0, 255, 255, 0, 0, 74, 255, 0,
74, 255, 255, 74, 74, 255, 255, 74, 255, 255, 255, 74, 74, 255, 255,
74, 74, 74, 74, 255, 255, 255, 255, 74, 255, 255, 255, 255, 255, 74,
255, 74, 74, 255, 74, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
74, 255, 74, 74, 255, 255, 74, 255, 0, 255, 255, 74, 255, 74, 255, 255,
74, 255, 74, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 74, 255, 74, 74, 255, 74, 255, 255, 255,
255, 0, 255, 74, 74, 255, 255, 74, 255, 74, 255, 255, 255, 255, 255,
255, 255, 255, 74, 255, 74, 255, 255, 74, 255, 74, 255, 255, 255, 255,
255, 255, 255, 255, 74, 255, 74, 255, 255, 74, 255, 74, 255, 255, 255,
255, 255, 255, 255, 255, 74, 255, 74, 255, 255, 74, 255, 74, 255, 255,
255, 255, 255, 255, 255, 255, 74, 255, 74, 255, 255, 74, 255, 74, 255,
255, 255, 255, 255, 255, 255, 255, 74, 255, 74, 255, 255, 74, 255, 74,
255, 255, 255, 255, 255, 255, 255, 255, 74, 255, 74, 255, 255, 74, 255,
74, 255, 255, 255, 255, 255, 255, 255, 255, 74, 255, 74, 255, 255, 74,
255, 74, 255, 255, 255, 255, 255, 255, 74, 74, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 74, 74, 255};
int pxCA[256] = {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 74, 74, 255, 255, 255, 255, 255, 0, 255,
255, 255, 255, 255, 74, 74, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 74, 74, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 74, 74, 255, 255, 255, 255, 255,
255, 74, 74, 255, 255, 255, 255, 255, 255, 74, 74, 255, 255, 255, 255,
255, 255, 74, 74, 255, 255, 255, 255, 255, 255, 74, 74, 255, 255, 255,
255, 255, 255, 74, 74, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 74, 74, 255, 255, 255, 255, 74, 74, 255, 255,
255, 255, 74, 255, 74, 255, 74, 0, 255, 255, 255, 74, 74, 255, 255,
255, 255, 74, 74, 255, 255, 255, 0, 74, 255, 74, 255, 74, 255, 74, 74,
255, 255, 74, 255, 255, 255, 255, 74, 74, 255, 255, 255, 255, 74, 74,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 74, 74, 255, 255,
255, 255, 255, 74, 74, 255, 74, 255, 255, 255, 255, 255, 74, 255, 255,
255, 74, 255, 255, 74, 255, 255, 255, 74, 74, 255, 255, 255, 255, 74,
74, 255, 74, 255, 74, 74, 255, 74, 255, 255, 74, 255, 74, 255, 255,
255, 255, 255, 255, 255, 74, 74, 255, 74, 0, 255, 255, 255, 74, 74,
255, 255, 255, 255, 255, 255, 255, 255, 255};
int i =0;
void setup() {
Serial.begin(9600);
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);
pinMode(2, OUTPUT);
digitalWrite(2, HIGH);
}
void clockwise(int steps, int delay1){
for (int i = 0; i < steps; i++){
setpins();
position++;
if (position == 4){
position = 0;
}
delay(delay1);
}
}
void counterclock(int steps, int delay1){
for (int i = 0; i < steps; i++){
setpins();
position--;
if (position == -1){
position = 3;
}
delay(delay1);
}
}
void setpins(){
digitalWrite(motorPin1, step1array[position]);
digitalWrite(motorPin2, step2array[position]);
digitalWrite(motorPin3, step3array[position]);
digitalWrite(motorPin4, step4array[position]);
}
void loop() {
/*
counterclock(200,stp_hum);
counterclock(100,stp_beep);
counterclock(100,stp_fast);
counterclock(10, stp_med); //quite turn
counterclock(10,stp_slow ); //louder turn
counterclock(10,stp_sub_low); //louder turn
counterclock(10,stp_micro_low); //louder turn
*/
play_ac(ac_med);
for(i =0; i<200;){
counterclock(random(10, pxCA[i]),stp_hum);
i++;
counterclock(random(10, pxCA[i]+200),stp_beep);
i++;
}
delay(1000);
counterclock(10000,stp_beep);
if(count <= 12){
clockwise(20000,2); //4" travel down (clockwise)
}else{
counterclock(20000,2); //4" travel up (counterclock)
}
if(i >= 1463){
i=0;
}
count++;
if(count>=24){
count = 0;
}
delay(600);
//Serial.println(count);
}
void play_ac(int val) {
digitalWrite(2, LOW);
delay(val);
digitalWrite(2, HIGH);
}
|

Linear cellular automata from the "Edge of Chaos CA" java software
developed by David Eck from the Department of Mathematics and Computer
Science ,Hobart and William Smith Colleges Geneva, NY.
Using a simple custom pro55e5ing program, the image is decoded
pixel-by-pixel and encoded into an array of arduino compatible delay
values utilized by the box. |





|