Friday, September 20, 2013

Simple Kitchen Computing Interface: Wiimote + Laptop







Step 1: Assemble your materials

You will need:

One Wii remote

One sacrificial/reusable/sanitary pouch for your wiimote (I use a sandwich bag and then wash it with the rest of the dishes—make sure it is completely dry before you reuse it!)

One bluetooth-capable laptop, netbook, or equivalent with a recent install of Processing

Wiimote-interpreting software. I use Osculator, which is free for awhile and then ~$30 to keep. It comes in handy for many things, so I consider the purchase to be well worth it. If you don't want to spend any money, you can try doing ti all in Processing, Flash, or Java; they all have pretty good wiimote libraries.

Step 2: Prepare Wii remote

           Just put the wiimote in the bag, press the air out, and seal it. Use two bags if you're paranoid.

Step 3: Set up your Wiimote-to-laptop routings

        Download the attached Osculator patch and save it somewhere convenient.

Download the attached Processing sketch and save it in the same place.

Guess What: You have to be an Instructables member to be able to download attachments! And, Instructables does not preserve file names or extensions! So, no files included here. Instead, head to http://github.com/AKAMEDIASYSTEM/KitchenWiimoteInterface and get everything you need over there.

Open the Osculator patch and connect your Wiimote - make sure the Wiimote you use is set as "Wii 1" in the Wiimote Drawer of Osculator.

Start the Processing sketch.

Using the keyboard, make VLC is the foreground application and Firefox is behind it (ie, so that in VLC pressing Command-Tab gets you to Firefox, and vice versa).

Stark cooking!

Please see the attached diagrams for a summary of button-to-function mappings for VLC and Firefox.

 

Step 4: Cook!

           You're done - now you can watch movies and consult recipes while you have your hands deep inside a turkey! The Wiimote will work from inside a turkey too!

Step 5: Do more / Next Steps

KNOWN QUIRKS:

- The system assumes that VLC is in the foreground when you start. It assumes from then on that you are just switching between Firefox and VLC. You can re-write the scripts to include an arbitrary number of applications and behaviors, though...have at it!

- The system works best with a quick click of the B button rather than a long press. You might have to practice once or twice to get the timing right.

DO MORE:

- I've attached a blank wiimote template in .ai format if you'd like to alter the patches and make your own mappings.

- I've done my best to comment the (very straightforward) Processing sketch in a helpful way. The code is also available on github

Browse through some other Instructables to get ideas about where this could go; this one was only the beginning! Think about what it means to have an inexpensive, expressive, handsfree input device that can take the place of a keyboard and mouse for many tasks.

If you own a small projector, lucky you! Now you can mount it over your countertop and turn your food prep surface into a display! Or even better:

http://www.instructables.com/id/Low-Cost-Multi-touch-Whiteboard-using-the-Wii-Remo/

If you own a webcam or some IR light pens, you could make this a display AND a multitouch input, even if your hands are covered in dough!

Turn your Arduino Uno into an USB-HID-Mididevice


Step 1: Gather your materials

Things you need:
- A compatible Arduino board. I'm using the Arduino Uno here.
- An AVR-ISP programmer. The AVRISP mkII works great and is used here.
- Software to use your ISP programmer; up and running. I'm using the AVR crosspack with avrdude on my MacBook Pro.
- The HIDUINO software from here http://code.google.com/p/hiduino/downloads/list

To get ready for the next steps you have to unpack the HIDUINO archive.

In the unpacked file move to the folder "Arduino Libraries". Inside you will find another folder called "HIDUINO_MIDI_Lib".
Move this folder into your Arduino - Libraries folder.
The final result should look like this /Users/phil/Documents/Arduino/Libraries/HIDUINO_MIDI_Lib

We haven't moddified the original USB firmware yet, so it's still intact and you can use it to flash an example sketch to your Arduino.
Try the first sample from the HIDUINO archive. It's located under "Arduino Example Sketches" and really easy to understand.
You don't have to do this yet, but it allows you to test your device immediately after reflashing the USB firmware.

Step 2: Programming the new USB firmware

                Okay, the first thing we want to do is to reflash the Uno's 8u2 chip.
Therefore we need to do the following:

- Connect your ISP to your Arduino. (Be sure to connect it in the right way! The pinheader should be marked with a little white dot! It marks pin number one! On the ISP cable it's marked with a little arrow.)
- We want to flash the following file: HIDUINO/CompiledFirmwares/HIDUINO_MIDI_Uno.hex
- I'm using avrdude in a terminal window on my Mac. I used the following command  for an Arduino Uno and an AVRISP mkII:
avrdude -p at90usb82 -F -P usb -c avrispmkii -U flash:w:HIDUINO_MIDI_Uno.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

- after 6-10 seconds the new firmware should be flashed successfully! Your device should show up in your system profiler now! If not just unplug it and replug it back again :) Then you can move on to the next step! :)

- In case you want to restore the original frimware of the 8u2 you can find it in your Arduino application folder. On a Mac its located under:
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/firmwares/UNO-dfu_and_usbserial_combined.hex
- Reflash it using avrdude an this command:
avrdude -p at90usb82 -F -P usb -c avrispmkii -U flash:w:UNO-dfu_and_usbserial_combined.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

There are tons of instructables and tutorials on how to flash an AVR using avrdude. This is just a short sum up of paths and commands ;)

Step 3: Programming the Uno using ISP

             After successfully flashing the USB firmware you can't upload sketches over usb anymore.

I wanted to keep the ability of using the Arduino software to upload the sketches over ISP.
Therefore you have to edit the boards.txt located under: /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/boards.txt

Add the following code to the textfile and save it.

##############################################################

avrispmkii.name=AVRISP mkII w/ ATmega328

avrispmkii.upload.protocol=avrispmkii
avrispmkii.upload.maximum_size=32256
avrispmkii.upload.speed=19200
avrispmkii.upload.using=avrispmkii

avrispmkii.bootloader.low_fuses=0xff
avrispmkii.bootloader.high_fuses=0xde
avrispmkii.bootloader.extended_fuses=0x05
avrispmkii.bootloader.path=optiboot
avrispmkii.bootloader.file=optiboot_atmega328.hex
avrispmkii.bootloader.unlock_bits=0x3F
avrispmkii.bootloader.lock_bits=0x0F

avrispmkii.build.mcu=atmega328p
avrispmkii.build.f_cpu=16000000L
avrispmkii.build.core=arduino


##############################################################


Now it shows up in the Arduino software.

Just choose the newly created board, connect your ISP the right way and upload your sketches like you always do :)

Browse to your HIDUINO folder and upload the following example (if you haven't done it already ;)): /Users/phil/Downloads/HIDUINO/Arduino Example Sketches/HIDUINO_MIDI_Example01/HIDUINO_MIDI_Example01.pde

Thats it!! Fire up Ableton Live or any other music program and listen to your Arduino generated notes!! (Don't forget to configure you music program to talk to your device.)

It's my first Instructable and I hope it helped you a bit to get the HID/Midi running :)

In a few weeks I'll show you how to create the hardware for a  4-channel midi controller :)

How to Install Flash on Ubuntu Linux, the easy way!







Step 1: Getting the required stuff

            before doing this please follow This instructable, otherwise this will not work you can find it

ok first you need to go to http://www.adobe.com then click the "get flash" icon on the right hand side of the page. It should automatically detect the fact that you are using Linux and give you the correct file types.

click download, and save to disk the tar.gz file you DON'T want the .rpm or YUM files.

Step 2: Actually installing it

             it won't work yet, go to a website that uses flash, a good example would be www.youtube.com

try and play a video, it won't work thats what we are going to do now, make it work, over the next two steps!


go ahead and open the tar.gz file, and click extract, a new window will pop up, asking you where you want to extract it to, select your desktop (it should select your desktop by itself anyway).

Step 3: Installing it

             actually some of the online tutorials and that I have read make this bit seem really complicated, there is a way to do this using the sudo (super user do) command, but that is quite complex for first time users also if you follow this method rather than the sudo method (which is harder) you will have to do this for every user on you computer (i think.)

anyway, go to the desktop, you will see a folder called the same thing as the tar.gz file you downloaded (something like install_flash_9_linux)

open that folder, you will see that there are two icons in that, click on the FlashPlayer-Installer Icon

now you should get a message, choose "run in terminal" now here is the first time that you are actually going to have to use a command line, and it is really easy!

make sure you read all the instructions as they come up, make sure you have no browsers running, that means Firefox Sea monkey etc.

when you see the "install action summary" press Y (yes) and enter, if you press Q it will give you a load of info about it (boring) or N will not install it (it means no).

let it do its thang, and when it is finished, close it and start firefox, go to youtube and viola

Step 4: After Thoughts

           I believe you can preform a similar procedure to this using Java although I have not installed it (I have no need for it, though obviously getting the required files will be different seeing as it will be from sun micro systems not adobe)

Also although this instructable can help you avoid using Ubuntu's command line (terminal) as much as possible it is a good idea to be able to use it and be relatively competent in its use, because there will be times when you have to use it!

but you will in time get to learn the basic commands such as "sudo apt-get install" etc in time, its all part of the Ubuntu experience (how corny does that sound)

I do read my comments so if this isn't working for you, please use the comments section and I shall endeavor to to help you, (after all it is part of the concept of Ubuntu, remember "I am because you are."

Peace

F1x0r

Brown Sugar Java Fizzie






Step 1: Ingredients

2-2/3 cups water

1 c. coffee beans (or pre-ground coffee), medium to coarse grind
Coffee press or strainer lined with cheesecloth
Whole spices, if desired

Seltzer water
Vanilla extract (optional)

Step 2: Heat water and add ground coffee

           In a saucepan, bring the water to just boiling, and stir in the ground coffee, and spices (if desired).
Remove from heat, and pour into coffee press, or cover and leave on stove top if using a colander to drain (next step).

Step 3: Steeping

             Allow the coffee to steep until cool (up to four hours).

When the coffee has cooled:
For the coffee press, simply push the handle down as far as it will go.  If you're using a cheesecloth-lined colander, Set the colander (strainer) over a bowl, pour the coffee, grounds and all, into the cheesecloth, and bring up the sides of the cheesecloth, forming the coffee grounds into a ball.  Twist and squeeze! 

You should have about 2 cups of insanely strong coffee.

Step 4: "Cooking" the syrup

           The word "cooking" is in quotes, because you really don't want to do much more than heat the brown sugar until it dissolves in the coffee.
If you allow the syrup to boil, you will wind up with a heavy concoction that won't dissolve smoothly in the seltzer.  It  might work for an ice cream topping, but......HEY!  There's your second batch!

In the saucepan, combine the brown sugar and coffee over medium-low heat, and stir until the sugar is dissolved -- usually right around the time the mixture is thoroughly heated (too hot to touch), but not boiling.
Remove from the heat and allow to cool.   If you see a thin, foamy layer on top, just stir it right back in.

Adding 1 teaspoon of vanilla is optional, but it's a very nice touch.
Store in the fridge -- the syrup should keep well for at least several weeks.

Step 5: Finishing

             Make sure your seltzer is very cold.  If possible, have the syrup chilled as well.

Measure out an ounce or two of syrup.

Fill your glass halfway with seltzer, and then very, very slowwwwwwly, begin to pour the syrup into the glass.  If the seltzer foams up, just pause and wait until everything settles, stir gently, and then continue adding.  Taste-test intermittently.  Keep track of how much syrup you add, so you'll be able to establish your preferred ratio of seltzer to syrup.

It's Brunchtime!

Enabling non free software on Ubuntu 7.10 (real quick and easy)







Step 1: The one and only step to doing this

             look at the top of the screen,

choose system, go to administration and click on "software sources"

Ubuntu will ask you for your password so enter it. Make sure no one including the government is looking over your shoulder. *Puts on tin foil hat*

ok now it will open a program with some check box options, check them all, this will allow you to use all repositories, including the restricted and multiverse repositories.

done.

Integrate Ardublock with Arduino IDE







Step 1: Install Arduino IDE

          Download any version of Arduino IDE (here i'm using ver1.0.5) and install it on computer (executable arduino installer is available,so you no need to unzip and copying files)

You can find a desktop shortcut as "Arduino"

Step 2: Download Ardublock

Use this link to download  ardublock-all.jar

http://download1us.softpedia.com/dl/6200a2d98a8df7e8fcd3c120668daa45/51c06f70/100229541/software/programming/ardublock-all-20130607.jar

Rename ardublock-all-20130607.jar to ardublock-all.jar and copy this file.

Step 3: Integrate

1.Now open "My documents" and create new folder as "Arduino".


2.Open "Arduino" folder and create new folder as "tools".
 

3.Open "tools"  folder and create new folder as "ArduBlockTool".
 

4. Open "ArduBlockTool" folder and create new folder as "tool".
 

5.Open "tool" and paste "ardublock-all.jar" here.

 

Step 4: Change sketchbook location

           Now open Arduino IDE and press ctrl+,(comma) then a prereferences window will open here you will find Sketchbook location and change sketchbook location to E:\Documents\Arduino\tools\ArduBlockTool\tool\ardublock-all.jar then press "OK".

Note: Location is deponds upon where you have ardublock-all.jar

Step 5: Restart Arduino IDE and Done

            Now you can find Ardublock under tool menu Tool>Ardublock  and click it.

Step 6: Start Programming in GUI

             Done!!!!!!!!!!!!!!!

Time Lapse Photography - the lazy way!




Step 1: What you will need

Hardware:

Old Java (MIDP 2.0) compatible phone
Some sort of datacable for the phone
Phone carrycase

Software:

J2ME Development kit
FAR manager (optional - depends on state of phone)

Step 2: Write the software

            This is the hard part, believe it or not, there isnt any java based software that does this for phones. There are a couple of python based ones that will work on a Nokia phone, but not my nokia phone :/

I've attached the java files here, I'm NOT attaching the compiled versions though. If you're clever enough to compile/package these then you're clever enough to fix things if they dont work :p

Basically, it presents a menu where you can set the name of the image-set and the timelapse duration. It then spawns a timer that takes photo's and saves them on the memory card.

These are written with the SonyEricson W800 in mind. They should work with any midp2.0 compatible phone though

Step 3: (Optional) hack phone firmware to be less annoying

All apps that access the phone camera and memory must have permission to do so, otherwise they ask for it. Everytime.

Yes, that gets annoying so..

To fix this you have to "sign" the application, which costs money. Not interested! A cunning workaround is to hack the phones firmware to not prompt. Thats done with the FAR manager software and associated plugins

For the W800, the patches are here. They can ruin your phone if you dont pay attention. I'm not supplying instructions here, I dont want hundreds of "Lol I bricked my phone fix it plzzzz kthxbye" comments

My phone now no longer asks me for permission to run the software 

 Step 4: Use it!

            Start the software up, on my phone its in the file manager, then "Games" (because of the rubbish transfer software)
Set the duration (I've chosen 60 seconds here)
Set the name (new, because I'm too lazy to type them)

Hit the "more->go" button and put the camera in the case. Wear it!

Step 5: A test!

                heres the first test, a standard time lapse clock gif :)

I did wear this on my bag whilst wandering to the shop, sure enough I'd left the lens cap shut. I'm planning some sort of strap to attach it to my bag strap and point forward. The pictures are about 30kb each and the camera has a 512mb memory card, so thats about 17000 pictures before it fills up. At 15 second durations thats about 70 hours worth of clips.


So I might just leave this on all day and see what happens :)