I use the Raspian distro on my Raspberry Pi.
I installed Python, WiringPI and WiringPI-Python - a good write up on setting this up can be found here:
Next, I export the pins I will be using. I need two pins as outputs, so in a shell I type:
Now I can play around with pin 18 and 23.
Next, I write a python script to allow me to input exposure time, interval and number of shots. Here it is:
You may notice the motor time is 72.8 / number of shots - this means I can select a number of shots and the Pi works out the motor times needed to run the length of the track.
I save this to a file named 'timelapse.py'.
To make this easier to run in the field, I create a bash script to export the pins then run the python script:
And save this as t.sh. I made it executable so I simply need to type ./t.sh in a shell to get things up and running.
I needed a way to control the Pi out in the field where there are no other computers to SSH into the Pi. I have an Android phone,
I bought a bluetooth dongle (a cheap Tecknik brand nano one from Tescos did the trick) and set this up to use the IP 192.168.50.1.
See my update below - I now use an ad-hoc wifi network for communication, which seems a more stable solution.
Once paired with my phone I can then SSH into the Pi using the ConnectBot app.
Well. my phone died on new years eve, so I've been downgraded to an older android device. This one wouldn't talk to the Pi through bluetooth, so instead I set up an ad-hoc wifi network to connect the phone.
This was straight forward enough - I edited /etc/network/interfaces and added the following:
I also installed Screen on the Pi - this allows a session to run after SSH is disconnected so I can walk away from the rig whilst it still runs the last command I gave it.