First steps

10 Nov

In our first meeting as a group, we got familiar with the Lilypad Arduino board, its digital and analog pins and we started to experiment with LEDs. We started by connecting one white LED in our Lilypad board and then we added one more and programmed them to blink one at a time.

We experimented with the Blink example that comes with the Arduino 0.22 platform. Source code:

/*
  Blink
 Turns on an LED on for one second, then off for one second, repeatedly.

 This example code is in the public domain.

 Modified by smartcraftLab on 2011
 */

void setup() {
  // initialize the digital pins as outputs.
  pinMode(5, OUTPUT); // Pin 5 is connected to an LED
  pinMode(6, OUTPUT); // Pin 6 is connected to an LED

}

void loop() {
  digitalWrite(5, HIGH); // set the pin 5 LED on
  digitalWrite(6, LOW);  // set the pin 6 LED off
  delay(1000);           // wait for a second
  digitalWrite(6, HIGH); // set the pin 6 LED on
  digitalWrite(5, LOW);  // set the pin 5 LED off
  delay(1000);           // wait for a second
}
Advertisements

One Response to “First steps”

  1. Mr WordPress November 10, 2011 at 4:53 pm #

    Hi, this is a comment.
    To delete a comment, just log in, and view the posts’ comments, there you will have the option to edit or delete them.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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

%d bloggers like this: