Instructables

Awesome button with a leostick

so you have all probably wanted to make an awesome button bu didnt know how...
here are the instructions to how i made my awesome button with a leostick not an attiny
you will need:
a computer
your leostick
the code




##exceptional update 2##
i made a new case for it so now it looks first-rate 
haha i used the awesome box to make the marvelous words in this superb update and once again the exceptional does its job....


##brilliant update 3##
does anyone know how to add a ctrl z button to a leostick, ive been trying but its hard

##update##sites mentioning this
http://www.freetronics.com/blogs/news/7021290-create-an-awesome-button-with-a-freetronics-leostick
http://www.dumpserver.co.uk/pages/1152898-awesome-button-with-a-leostick
http://yticadu.appspot.com/iblefeed
http://twitter.com/DIYEngineering/statuses/277583779885899777
http://freetronics.blogspot.com.au/2012/12/create-awesome-button-with-freetronics.html

i
f you mention this on another site PLEASE tell me in the comments
 
Remove these adsRemove these ads by Signing Up

Step 1: The code...

the code was modified from the original to work with a leostick
you can also add words and change them to your favorite cheats from games



const byte NUMBER_OF_WORDS = 27;
char* words[NUMBER_OF_WORDS] = {
"neat", "cool", "wicked", "incredible", "excellent", "crack", "exceptional", "fantastic",
"fabulous", "fine", "first-rate", "marvelous", "super", "terrific", "tremendous", "wonderful",
"brilliant", "superb", "keen", "laudable", "worthy", "rad", "sweet", "fresh", "dope", "fly", "nifty"
};

void setup(){
randomSeed(analogRead(0));   //give the random number generator funky data as a seed
pinMode(0, INPUT);           // set pin to input
digitalWrite(0, HIGH);       // turn on pullup resistors
delay(5000);
}

void loop(){
  if (digitalRead(0) == LOW) // is the button pressed?
  {
    Keyboard.print(words[random(0,NUMBER_OF_WORDS)]); // type a randome word from our list
    Keyboard.print(" "); // and add a space
    delay(500); // wait a half a second
  }
}
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!