Sider

fredag 6. juli 2012

Arduino key board Prank


I work at an office and there is always some pranks going around. One of them was plugging a second keyboard in to the computer and typing away while the other guy was trying to write emails.
So I thought way not make it a little more advanced, and make a device to do it all for me. I had an old teensy 1.0++ laying around. So the prank is as easy as setting it up to emulate a usb keyboard. Then have it press keys and write messages with a set interval. The way I programmed it in the code under is:

First hours: toggle caps lock every 2.5 min
Second hours: Press alt-tab (change window) every 2.5 min
Rest of the day: Type random messages on the screen

The teensy board
As you can see this quickly gets pretty irritating. But when you start looking for who’s pranking you the regular guy is sitting quietly typing on his key board. And it’s easy to change for your own messages and keys.
To make it less detectable you can use a USB-hub, so that there is no more cables then usual going in to the computer.


/*
Arduino USB key borad prank
*/

int count = 0;
bool caps;

void setup() {
delay(1000);
}

// toggle caps-lock
void toggle_caps_lock() {
if (!caps) {
Keyboard.set_key1(KEY_CAPS_LOCK);
caps = true;
} else
{
Keyboard.set_key1(0);
caps = false;
}

Keyboard.send_now();
}

// ALT-TAB
void chage_app() {
Keyboard.set_modifier(MODIFIERKEY_ALT); // Press alt
Keyboard.send_now();
Keyboard.set_key1(KEY_TAB); // Press tab
Keyboard.send_now();

Keyboard.set_key1(0); // Release keys
Keyboard.set_modifier(0);
Keyboard.send_now();
}


void write_rnd_msg() {
char* msg[15];

msg[0] = "I am a sucker ";
msg[1] = "Hugs and kisses ";
msg[2] = "stupid ";
msg[3] = "Whats going on with my computer ";
msg[4] = "Im messing with you ";
msg[5] = "What??? ";

int rand = random(0, 5);

Keyboard.print(msg[rand]);
}

void loop() {
count = count + 1;

if (count < 120) { // first hour
if ((count%5) == 0) {
toggle_caps_lock();
}
}

if ((count < 240)&&(count > 120)) { // second hour
if ((count%5) == 0) {
chage_app();
}
}


if (count > 240) { // the rest of the day
if ((count%10) == 0) {
write_rnd_msg();
}
}
delay(30000);
}


fredag 8. juli 2011

Make your own capsules/pods for the nespresso machine

Ever thought about using your own coffee in a Nespresso coffee maker. Well you can, by recycling your old capsules. It's cheaper any you can use your favorite type of coffee. All you need is, a coffee filter, some tin foil and some espresso coffee.
Start by removing the used coffee from an old capsule.

Take a normal coffee filter and cut a small circle that fits on top of the capsule as shown in the image.


Cut a piece of tin foil and wrap it over the top of the capsule.



Make small holes in the tin foil. The machine will not do this automatically like on normal pods. Voila you now have your own capsule for the Nespresso machine. Enjoy your coffee.

Update: I had some problems with water coming out in the start of the brev. The solution to this was to put the capsule in your mouth and blow. So that the coffee gets pressed up to the lid of the capsule. Please comment if someone fines a better solution to this problem..