Things used in this project

Code

Code to allow the Raspberry Pi to drive the focus stacking railPython
This code enable the Raspberry Pi to drive my focus stacking rail to achieve micron sized steps and to automatically trigger the camera after each step.
#!/usr/bin/env python

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

#This assigns the pins of the raspberry pie to variables called "pin".
pin0 = 18
pin1 = 23
pin2 = 24
pin3 = 17

#Set these pins to send messages out rather than listen for messages coming in. 
GPIO.setup(pin0, GPIO.OUT)
GPIO.setup(pin1, GPIO.OUT)
GPIO.setup(pin2, GPIO.OUT)
GPIO.setup(pin3, GPIO.OUT)

#Zero all of the pins between tests. 
def zero_pins():
time.sleep(0.1)
GPIO.output(pin0, 0)
GPIO.output(pin1, 0)
GPIO.output(pin2, 0)
GPIO.output(pin3, 0)

#This runs the test.
def test():

count = 1
while (count < 10000):
print 'The count is:', count

zero_pins()
GPIO.output(pin0, 1)

GPIO.output(pin1, 1)
zero_pins()

GPIO.output(pin1, 1) 
GPIO.output(pin2, 1) 
zero_pins()

GPIO.output(pin2, 1) 
GPIO.output(pin3, 1) 
zero_pins()

GPIO.output(pin3, 1) 
GPIO.output(pin0, 1) 
zero_pins()

count = count + 1
test()
Github
https://github.com/BioMakers/23_Focus-stacking-system-for-gametophyte-ferns

Credits

29998005
Jennifer Deegan
13 projects • 4 followers
I am working on deep focus photography of specimens from 0.5mm to 2.5mm tall. I would be interested in receiving commissions.
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaBlog