3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Build your own (cheap!) multi-function wireless camera controller.

Step 15Writing The Code

The code is, again, attached. There are two versions. One will work with Canon, one will work with Nikon.  Check in the folders, look for "Intervalometer Test.c".  Edit the makefile so that it looks for this c file when compiling.

The process is very much the same, however. We define some names for each pin so that the code is more understandable.

Then, we write the init function again, but this time we set all of Port D to be output and only one pin on Port C to be output - the LED we added last time.

Next, we write the actual shoot function. The premise is simple, each on/off cycle for the LED takes 26uS, we divide up the pulses into 26uS chunks and then repeat on/off cycles that many times. Pauses in-between pulses are just normal delays. The code is commented as to how the timings are worked out. The loops are just for loops.

The main program is pretty simple. We initialise our input/output. Then, we go into the infinite loop, turn on the LED (not status LED) and call the shoot function. We then turn off the LED and wait 5 seconds. This loop will repeat endlessly.

If you want a really really simple intervalometer, you just made one. Simply set the delay to whatever you need (there is a Delay_s function too) and the program will loop until you turn the power off.

Upload your code to the micrcontroller as before, remember to connect up the crystal/capacitors. Test out your program and check out the range. LEDs are pretty directional so you'll need to point it more or less normal to the camera's IR port to guarantee a picture at a longer range. At a right angle to the camera, i got about 2m range. Facing the chip head on i got around 5-10m+. This range will decrease somewhat outside, but it will still work if you hold the emitter close to the camera.

Next up, buttons.
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
15
Followers
1
Author:Whiternoise
I'm a third year physicist at Warwick University, dabbling in electronics and photography and currently seeing what interesting combinations you can make with the two :)