Skip to content

Instantly share code, notes, and snippets.

@cdeister
cdeister / gist:a9a8073963ee7c8869aed68aaa2f9420
Last active July 24, 2019 17:02
Sci-Maker Links (NS&B 2019)
Raspberry Pi Camera:
The stock camera is nice. But, you can get the same sensor from many 3rd parties that also has an "M12" lens mount. This is like the one we used in lab. You can get a lens set and find the right one for your purposes and FOV:
Link to M12 lens kit
https://www.amazon.com/dp/B07L92S9MT/ref=twister_B07P935WRY?_encoding=UTF8&th=1
Links to camera:
IR sensitive with M12 mount:
https://www.amazon.com/Arducam-Camera-Raspberry-Interchangeable-LS-2717CS/dp/B013JV4Z7K?ref_=fsclp_pl_dp_1&th=1
from picamera import PiCamera
from time import sleep
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.IN)
camera = PiCamera()
inPreview=0
@cdeister
cdeister / cadCSVLook.m
Last active December 12, 2017 15:33
Matlab script debuging Eric CSV 12/11/2017 Eric needs to sign up for GitHub
%% plot the first write
% 1) plot all
figure(309)
subplot(2,1,1)
plot(aa.psDatatm,aa.psDatav1,'k-','linewidth',1)
% and derivative
hold on
plot(aa.psDatatm(2:end),diff(aa.psDatav1),'r-','linewidth',1)
% subplot
figure(100)
h3=subplot(1,6,1:4);
hold all
for n=1:numel(session.lick_times)
if numel(session.lick_times{n}>0)
if analyzedBehavior.hitTrials(n)==1
mColor=[0 0 0];
elseif analyzedBehavior.hitTrials(n)==0
mColor=[0 0 1];
-- This script can be used in conjunction with Better Touch Tool to display the currently playing track on the MacBook Pro TouchBar
-- More info here: https://lucatnt.com/2017/02/display-the-currently-playing-track-in-itunesspotify-on-the-touch-bar
-- modified with VOX's dictionary
if application "VOX" is running then
tell application "VOX"
if player state is 1 then
return (get artist) & " - " & (get track)
else
return ""