Making Things Interactive

February 20, 2008

Assignment 5, 6: Solar Power

Filed under: 5: Making Motion, 6: More Motion, Assignments, Thomas Hendrickson — tphendrickson @ 7:52 pm

So after a ton of trying, troubleshooting, finding help from friends, I finally got a transistor connection to work and got two DC motors running together off of a code. One motor spins a sun and after it powers up the plants (a 6 second delay from a incremented counter), the flowers spin on the other motor.

here is the code:


int sunPin = 7;        //sun motor pin
int flowerPin = 5;     //flower motor pin
int ledPin = 13;       //led runs as a check
int counter = 0;       //counts how long program has been running</code>

void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(sunPin, OUTPUT);
pinMode(flowerPin, OUTPUT);

}

void loop()
{

digitalWrite(sunPin, HIGH);    //turns on sun immediately

if (counter == 6)              //checks counter value
{
digitalWrite(flowerPin, HIGH);  //if counter high enough, turns on led and flower
digitalWrite(ledPin, HIGH);
}

else
{
counter++;      //if not long enough, counter is incremented
delay(1000);    //1 second delay
}

}

Course Notes – 19 Feb 2008

Filed under: Class Notes, Course Materials — jet @ 3:09 pm

Notes from Tuesday, 19 Feb 2008. Lots of sample code to experiment with in the notes and a couple of simple state diagrams to think about.

Iteration and State 1

Two Simple State Diagrams

Controlling an iPod from an Arduino (tutorial)

Filed under: Course Materials, References — jet @ 3:04 pm

This requires a bit of assembly, but it’s pretty straightforward.  Each of the controls on an iPod remote is attached to a pin on the arduino, then you just set pins HIGH and LOW as needed to manipulate the controls.

Tutorial is here, note that I haven’t actually tried this yet.

Blog at WordPress.com.