Making Things Interactive

January 29, 2008

Assignment 3: Lady Ada Tutorials

Filed under: 3: LadyAda Tutorials,Assignments,Thomas Hendrickson — tphendrickson @ 2:34 pm

It took me a while to get the arduino program up and running… it seemed to be some problem with the current software so I used an older version (Arduino 0009).

Here’s my code for the blinking lights, it blinks three different LEDs in succession:

int redPin = 13;
int greenPin = 11;
int bluePin = 12;

void setup()
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);

void loop()
digitalWrite(redPin, HIGH);
digitalWrite(redPin, LOW);
digitalWrite(bluePin, HIGH);
digitalWrite(bluePin, LOW);
digitalWrite(greenPin, HIGH);
digitalWrite(greenPin, LOW);
digitalWrite(bluePin, HIGH);
digitalWrite(bluePin, LOW);


Here’s my solution for the kilobyte calculator:

int drive_gb = 100;
long drive_mb;
long real_mb;
long drive_kb;
long real_kb;

void setup()

Serial.print(“Your HD is “);
Serial.println(” GB large.”);

drive_mb = drive_gb;
drive_mb = drive_mb * 1024;
drive_kb = drive_mb * 1024;

real_mb = drive_gb;
real_mb = real_mb * 1000;
real_kb = real_mb * 1000;

Serial.print(“It can store “);
Serial.println(” Megabytes!”);

Serial.print(“Your HD should be able to hold “);
Serial.println(” Kilobytes.”);

Serial.print(“But it actually can only hold “);
Serial.println(” Kilobytes.”)

Serial.print(“This is a difference of “);
Serial.print(drive_kb – real_kb);
Serial.println(” Kilobytes”);

void loop()



Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: