Making Things Interactive

January 28, 2008

Lady Ada tutorial

Filed under: 3: LadyAda Tutorials,Tiffany Yang — tyang1 @ 11:05 pm
Tutorial 4
 * Drive size calculator!

int drive_gb = 100;
long drive_mb;

void setup()                    // run once, when the sketch starts
  Serial.begin(9600);           // set up Serial library at 9600 bps

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

  drive_mb = drive_gb;          // temp result is stored as long instead of int
  drive_mb = 1024 * drive_gb;

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

void loop()                 // we need this to be here even though its empty


protoshield on top of microcontroller

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

Blog at

%d bloggers like this: