19. {
// start main loop
myservo. write (pos); // set servo speed/direction to the value of pos variable
tbuttonState = digitalRead (topButton); // read the state of the top button
bbuttonState = digitalRead (bottomButton); // read the state of the bottom button
if (bbuttonState == HIGH ) // if top button pressed
{newParameters(85, 93);} //calculate a speed in other direction
if (tbuttonState == HIGH ) // if bottom buttom pressed
{newParameters(96, 103);} //calculate a speed in other direction
timer +=10; // increment timer value by 10
if (timer >= stoptime)
//if run time limit is reached,
{
myservo. write (95); //stop servo
newParameters(80, 105); //compute new parameters
delay (randpause); // pause for a random time
}
delay (100); // pause for 100 milliseconds
if ( pos < 97)
{ digitalWrite (led2, HIGH );}
else
{ digitalWrite (led2, LOW ); }
//power on led2
//power off led2
if ( randpause > 2000)
{ digitalWrite (led3, HIGH );}
else { digitalWrite (led3, LOW ); }
if ( timer > 90)
{ digitalWrite (led1, HIGH );}
else { digitalWrite (led1, LOW ); }
}
// end main loop
void newParameters( int hi, int lo) // function to calculate new speed/direction, time
and pause
{
pos = random (hi, lo); //generate new speed/direction, within hi and lo limits
randpause = random (1000, 5000); // generate random pause between 1 and 5
seconds
pause = 100;
timer = 0; //set timer to zero
stoptime = random (50, 200); // generate random time to run servo
}
21. Thanks!
@rogerwhitson
www.rogerwhitson.ne
t
John Armitage. “From
Discourse Networks to
Cultural Mathematics:
An Interview with
Friedrich A. Kittler.”
Theory, Culture &
Society. 23.7-8 (2006):
17-38. Print.
James Carrott and Brian David Johnson. Vintage Tomorrows: A Historian and a Futurist Journey Through Steampunk Into
the
Future of Technology.
Sebastopol: Maker
Media, 2013. Print.
William Gibson and Bruce Sterling. The Difference Engine. New York: Bantam, 1991. Print.
Garnet Hertz. “Making Critical Making.” Critical Making: Introduction. Ed. Garnet Hertz. Hollywood: Telharmonium
Press, 2012. Print.
Erikki Huhmato. “From Kaleidoscope to Cybernerd: Notes Toward an Archaeology of the Media.” Leonardo. 30.3 (1997):
221-224. Print.
Bruno Latour. “An Attempt at a Compositionist Manifesto.” New Literary History. 41.3 (2010): 471-490. Print.
Shannon Mattern. “Deep Time of Media Infrastructure.” Signal Traffic: Critical Studies of Media
Infrastructures Ed. Lisa
Parks and Nicole
Starosielski. Chicago: U
of Illinois Press,
Forthcoming.
Michael Moorcock. The Warlord of the Air: A Scientific Romance. London: Titan, 2013. Print.
Jussi Parikka. “The
Geology of Media.” The
Atlantic. 11 October
2013. Web log post.
Matt Ratto. "Critical Making: Conceptual and Material Studies in Technology and Social Life." The Information Society 27.4
(2011):