online marty
Published

Digital Nishika n8000 with Raspberry Pi

From the moment I saw this camera (nishika), I wanted to make my own, but without the need for film.

BeginnerShowcase (no instructions)3 hours250
Digital Nishika n8000 with Raspberry Pi

Things used in this project

Story

Read more

Code

python code

Python
#here is my python code:  :))

import os
import time
import subprocess
import datetime
time.sleep(6)
commands = ['','','','']
p = ['','','','']
arr = ['','','','']
cameraindex = ['0','2','4','6']

for x in range(4):
    commands[x] = "sudo fswebcam -d /dev/video" + cameraindex[x] + " --no-banner" +" -r 640x480 "


for x in range(1):
    name = str(1000 + x)
    name = name[1:]
    print(name)
    for y in range(4):
        arr[y] = str(commands[y])+ "image" + str(y)+ "st" +name+ ".jpg"
        print(p)
        p[y] = subprocess.Popen(arr[y], shell= True);
    for y in range(4):
        p[y].wait()
    
    
    time.sleep(5)
ts = time.time()
ttime = "di3mg"+str(datetime.datetime.fromtimestamp(ts).strftime('%y%m%d_%H%M%S'))
print(ttime)
os.system("mkdir "+ttime)
os.system("python mkgif.py")
os.system("sudo mv image* "+ttime)
os.system("sudo mv "+ttime+" rpifolder")
print("done :)")
###########################################
#second file
from PIL import Image
import glob
 
# Create the frames
frames = []
#imgs = glob.glob("*.jpg")
imgs = ['image0st000.jpg', 'image1st000.jpg', 'image2st000.jpg', 'image3st000.jpg', 'image2st000.jpg', 'image1st000.jpg']
for i in range(6):
    frames.append(Image.open(imgs[i]))
print(imgs)
#frames.append(Image.open(imgs[2]))
#frames.append(Image.open(imgs[1]))
print(frames)

# Save into a GIF file that loops forever
frames[0].save('png_to_gif.gif', format='GIF',
               append_images=frames[1:],
               save_all=True,
               duration=100, loop=0)
##########################################

Credits

online marty

online marty

2 projects • 0 followers
Student with a bit of free time

Comments