Posts: 75
Joined: Wed May 08, 2013 11:53 am

Mac Classic turned Raspberry Camera

Sat Apr 12, 2014 1:37 am

Today I finished putting things together Ina crude way a gutted Mac Classic, RPi with car LCD from the abandoned DVD set to create a photo booth of sorts. I thought I would post my code for the creation since I used bits and pieces from several people to make it happen.

I am sure that the code could be cleaned up but it works for me at this point.

So far it will sit happily doing nothing. When the button is pushed it will show a preview for five seconds. Take the picture. Show the image for five seconds. Then back to the beginning.

A few things I plan to work on:
Need to make it auto run at boot
Create a message for people encouraging them to push the button
Create a count down visually on screen or with led
Auto upload to ftp server

The hope it to use this at our high school to gather buddy photos without a big production. Plug in and it works.

Code: Select all

import RPi.GPIO as GPIO

import os

from time import sleep

os.system ('clear')


GPIO.setup(23, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)

GPIO.setup(24, GPIO.IN, pull_up_down = GPIO.PUD_UP)

def printFunction(channel):

        print('Button 1 pressed!')

        print('Note how the bouncetime affects the button press')

GPIO.add_event_detect(23, GPIO.RISING, callback=printFunction, bouncetime=300)

while True:

        GPIO.wait_for_edge(24, GPIO.FALLING)

        import time
        import datetime
        date = datetime.datetime.fromtimestamp(time.time()).strftime("_%Y-%m-%d_%H-%M-%S")
       os.system("raspistill -o /home/pi/click/images/image" + date + ".jpg")

        os.system('fbi --once -t 5 -a /home/pi/click/images/*.jpg')

        os.system('mv /home/pi/click/images/*.jpg /home/pi/click/images/old')
        os.system ('clear')

sleep (5)
image.jpg (48.98 KiB) Viewed 2081 times

Posts: 75
Joined: Wed May 08, 2013 11:53 am

Re: Mac Classic turned Raspberry Camera

Tue Mar 28, 2017 7:25 pm

Cleaned up the computer a little bit. Button is now on the inside with a red plexi-glass cut to fit in the disk slot. Also I cracked the back of the CRT off using gloves, glasses, trashcan and a small hammer. So the screen has the old school CRT/Glass feel.
front.JPG (25.25 KiB) Viewed 1690 times
button.JPG (31.31 KiB) Viewed 1690 times
crt.JPG (40.97 KiB) Viewed 1690 times
Unit now powers on using the original power switch. I also salvaged the original power supply and cooling fan.

Upon booting it displays a 30 second delay to allow the WiFi to connect
Display message to press button to tweet a photo
Photo is captured at max resolution
Image is then flipped right to left, saved, and a scaled version is made
The scaled version is then posted to Twitter with a time stamped message.

The unit was used at my previous school at school dances for the students to take silly photos. Many parents would use the photos to see if their kid really attended the dance if they stayed since kids would take multiple images through out the night.

Return to “Camera board”