Skip to content

Instantly share code, notes, and snippets.

@pingud98
pingud98 / Particle.ino
Created March 23, 2019 18:12
Current beta code for the OpenAuto
//Open Auto code
//Arezzo release July 2018
//Released under the GPL V3.
//note that the number of live reservations in the system is stored in eeprom location 2046 (i.e. the last slot)
//ConfigCarFun
//Config string function - pass the master RFID and door mode via function.
//Car types
//1 = one button, wire to relay 1; pulse open, pulse close
@pingud98
pingud98 / CosmicPiV1_single_channel.ino
Last active September 23, 2018 23:01 — forked from heborras/CosmicPiV2_DUE_test_script.ino
A dev firmware for testing and characterizing the V2 board, SiPMs and slabs with an arduino DUE
/*work in progress - single channel mode for V1 cosmic Pi hardware.
to do - disable on board DAC (not used in V1, I2C instead)
Check pinouts for SPI/Single channel HV
Refer to V1 schematic from here:
https://www.ohwr.org/attachments/3847/CosmicPiV1point0.zip
*/
#include <SPI.h>
#include <Wire.h>
//updated to include a whole bunch of extra functions 120818
@pingud98
pingud98 / CosmicPi1point5C.ino
Last active September 7, 2018 21:45
Test code for cosmic pi calibrationersion 1 point 5 c
/*
Set point for testing - I think it was 1100?, 160, 160. PSU values are good, threshold tbc.
Features:
Working:
Set HV
Set Threshold
Print out events
ToDo:
Print precise GPS timestamps for events
HV calibration?
#modified All Seeing Pi to remove overlay and overlay button.
from picamera import PiCamera
#from gpiozero import Button
#from overlay_functions import *
from time import gmtime, strftime
from guizero import App, PushButton, Text, Picture
#from twython import Twython
#from auth import (
# consumer_key,
# consumer_secret,
@pingud98
pingud98 / CosmicPiV2Simulator.ino
Last active August 6, 2018 20:11
Simulate inputs and outputs for Cosmic Pi V2.
//Cosmic Pi V2 Simulator for Arduino DUE
//functions provided:
//outputs
//Analogue Out 0 -> Simulated PSU Voltage FB (open loop)
//Analogue Out 1 -> Simulated Events (SlowOutA/SlowOutB)
//GPS PPS Output -> 1 Hz
//Trigout -> 5Hz, randomomised
//Strig A out -> 10Hz, sync with trigout
//Strig B out -> 10Hz, sync with trigout
//inputs - to check detection is working
@pingud98
pingud98 / CosmicPiV2I2CSPItest.ino
Last active August 12, 2018 13:06
Test driver for Cosmic Pi - controls I2C and SPI for the PSU to allow voltage and threshold setting. Use with the PSU firmware and a scope to see cosmic rays, hopefully
#include <SPI.h>
#include <Wire.h>
//updated to include a whole bunch of extra functions 120818
/* Cosmic Pi SPI test routines - Master version, slave is commented out below. Runs on an Arduino DUE,
Pinouts:
MOSI - MOSI
MISO - MISO
SCK - SCK
Pin 10 - Pin 10 (SS)
GND - GND
@pingud98
pingud98 / DUESPITestMasterandSlave.ino
Created July 30, 2018 19:32
Arduino DUE SPI Master and Slave example
#include <SPI.h>
/* Cosmic Pi SPI test routines - Master version, slave is commented out below. Runs on an Arduino DUE,
* Pinouts:
* MOSI - MOSI
* MISO - MISO
* SCK - SCK
* Pin 10 - Pin 10 (SS)
* GND - GND
* 5V - 5V
@pingud98
pingud98 / CosmicPiV15dualpsu.ino
Created July 21, 2018 17:25
Set the HV channels on the cosmic pi V1.5 independently. Used for testing V2 hardware.
/*
Features:
Working:
Set HV
Set Threshold
Print out events
ToDo:
Print precise GPS timestamps for events
HV calibration?
@pingud98
pingud98 / skelworking.pde
Created June 27, 2018 19:35
Skeleton detection using kinect for Processing
/* --------------------------------------------------------------------------
* SimpleOpenNI User Test
* --------------------------------------------------------------------------
* Processing Wrapper for the OpenNI/Kinect 2 library
* http://code.google.com/p/simple-openni
* --------------------------------------------------------------------------
* prog: Max Rheiner / Interaction Design / Zhdk / http://iad.zhdk.ch/
* date: 12/12/2012 (m/d/y)
* ----------------------------------------------------------------------------
*/
@pingud98
pingud98 / Open_Close_auto.ino
Created April 14, 2018 16:12
Open_Close_Auto
// This #include statement was automatically added by the Particle IDE.
#include <Particle-GPS.h>
#include <ParticleSoftSerial.h>
#include "Particle.h"
//note that the number of live reservations in the system is stored in eeprom location 2046 (i.e. the last slot)
//This is licensed under GPL V3.
//status: