Thursday, 18 October 2012

Analogue Gauge Jitter with an Arduino

Heyho!

You know that classic movie moment when some pipe or other critical component is about to burst and explode? Most commonly used in submarine movies.

They normally show the impending doom with a gauge, with the needle WAY past the "Super Dangerous: Seek shelter if pointer is past this point!" mark.

Of course, the needle won't just stay in that position, it will bounce around (within the above mentioned mark) to give that extra edge of "shit's going down, yo!".

Imagine dramatic music playing

So, today, you will learn how to replicate this effect!

How to connect the analogue gauge:

You should have two wires coming out from the gauge. One positive and one negative.
Connect the positive end to Arduino's Pin 9 and the negative to Arduino's GND.

Now upload this code:
int gaugePin = 9;    

void setup(){}

void loop()
{

  analogWrite(gaugePin, random(7,10));
  delay(50);

}
 ...and you're set!

 This is a quick 'n' dirty solution, but I'm happy with it as it only needs one line of code to work!

How it works:

The code generates a random number and sends that to the gauge, changing it's position. The delay() determines the speed of the jitter. Change the speed (marked red) and random number range (marked in blue) for varying effects!

Keep in mind:
You will need to experiment around to see where your gauge's maximum range is.
Mine was around 11, so I used the range between 7 and 10 for a more pronounced jitter!

Conclusion:
It's awesome coolio.

Have fun and let me know if you build this into any of your projects!

Wednesday, 10 October 2012

Time-lapse with a Canon SX220HS

'sup.

Time-lapse (and slow-mo) videos have always interested me, so I finally made a short one myself!

As is evident by the post title, a Canon SX220HS was used. It had the Canon Hack Development Kit installed, though that was only for the intervalometer.

I will be covering the use (and how-to's) of the CHDK in a later post.

But for now, enjoy this waaaay too short video!
It's in 1080p!

You'd be best off watching it on YouTube. The embedded size of the video here is.. small.



Let me know what you think by leaving a comment (and a like!) on YouTube!

I've already got loads planned, so stay tuned.