So your Arduino can ‘Blink’, but can it ‘Get Down to Funky Town’?

The other day a good friend of mine sent me a link to this video and requested that I make my own version of the ‘Party Button’. Unfourtunately I am in high demand and due to time constraints, he had to settle for something much less complicated.

Admit it, you want one of your own now. It’s OK, dont feel ashamed. If anyone should be ashamed, its me.

Anywho, once you’re done accepting how lame you are, get prepared to learn how to make a ‘Funky Town Arduino’ of your own. Why? Because I am going to show you how to do it. I know what you are thinking and the answer is: Yes, I am that cool of a dude.

In order to make this, you will need 5 LEDs, a breadboard, a pushbutton, a 560 ohm resistor, some wire and of course, your Arduino. Once you have all that, put it all together like so:

layout

 board  thebutton
the board and light pins the button

Next, you need to make sure your Arduino knows its coreography. This code ought to help.

int bee = 13;
int bu = 12;
int bi = 11;
int boop = 10;
int bup = 9;
int time = 150;
int partybutton = 8;
int takemetofunkytown = 0;

void setup()
  {
    pinMode(bee, OUTPUT);
    pinMode(bu , OUTPUT);
    pinMode(bi , OUTPUT);
    pinMode(boop , OUTPUT);
    pinMode(bup , OUTPUT);
    pinMode(partybutton, INPUT);
  }

void loop()
  {
  //do you want to go to funky town?
  takemetofunkytown = digitalRead(partybutton);
    //only when i feel like it
    if (takemetofunkytown == LOW)
    {
      digitalWrite(bee, HIGH);
      delay(time);
      digitalWrite(bee, LOW);
      delay(time);
      digitalWrite(bee, HIGH);
      delay(time);
      digitalWrite(bee, LOW);
      delay(time);
      digitalWrite(bu, HIGH);
      delay(time);
      digitalWrite(bu, LOW);
      delay(time);
      digitalWrite(bi, HIGH);
      delay(time);
      digitalWrite(bi, LOW);
      delay(time);
      digitalWrite(boop, HIGH);
      delay(time);
      digitalWrite(boop, LOW);
      delay(time);
      digitalWrite(boop, HIGH);
      delay(time);
      digitalWrite(boop, LOW);
      delay(200);
      digitalWrite(bi, HIGH);
      delay(200);
      digitalWrite(bi, LOW);
      delay(200);
      digitalWrite(bu, HIGH);
      delay(100);
      digitalWrite(bu, LOW);
      delay(100);
      digitalWrite(bee, HIGH);
      delay(100);
      digitalWrite(bee, LOW);
      delay(100);
      digitalWrite(bup, HIGH);
      delay(125);
      digitalWrite(bup, LOW);
      delay(100);
    }
  }

Upload that into your board and poof! Funky town is just a push away!

…I really need to get out more.

Advertisements

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