Skip to content

Instantly share code, notes, and snippets.

#define LOG_PERIOD 20000 //Logging period in milliseconds
#define MINUTE_PERIOD 60000
volatile unsigned long counts = 0; // Tube events
unsigned long cpm = 0; // CPM
unsigned long previousMillis; // Time measurement
const int inputPin = 2;
void ISR_impulse() { // Captures count of events from Geiger counter board
counts++;
/**
*
* Pin D2 -> Arduino Interruption
* Pin D7 -> Buzzer
* Pin D8 -> Led
* Pin D9 -> External Interruption to connect other Arduino/Raspberry
*
*/
#define LOG_PERIOD 20000 //Logging period in milliseconds
#!/bin/python
import RPi.GPIO as GPIO
import time
LOG_PERIOD = 20000
MINUTE_PERIOD = 60000
counts = 0
cpm = 0
/**
* ATtiny85 as an I2C Slave
* ATtiny I2C slave receiving and sending data to a RaspberryPi master.
*
* ATTiny Pin 1 = (RESET) N/U ATTiny Pin 2 = (D3) BUZZER)
* ATTiny Pin 3 = (D4) to LED1 ATTiny Pin 4 = GND
* ATTiny Pin 5 = I2C SDA ATTiny Pin 6 = (D1) to LED2
* ATTiny Pin 7 = I2C SCL ATTiny Pin 8 = VCC (2.7-5.5V)
*
* Use pullups on the SDA & SCL lines! (4k7)
#!/bin/python
import smbus
import time
# This is the address we setup in the Arduino Program
address = 0x2d
def writeNumber(value):
#!/usr/bin/python
# Example using a character LCD plate.
import Adafruit_CharLCD as LCD
import time
import commands
from subprocess import PIPE, Popen
from time import sleep, strftime, localtime
from datetime import datetime, timedelta
class Utils:
/////// RopeNode.h
#import "cocos2d.h"
#import "ObjectiveChipmunk.h"
struct RopeNodeParticle;
@interface RopeNode : CCNode {
ChipmunkBody *_body1, *_body2;
cpVect _offset1, _offset2;
@sergiomtzlosa
sergiomtzlosa / swift-infix-uiappearance
Created August 26, 2014 15:55
swift-infix-uiappearance
/*
let imageColor : UIImage! = UIImage.imageWithColor(UIColor.redColor())
"UINavigationBar" => imageColor
*/
import Foundation
import UIKit
//
// SMSync.swift
// TableExample
//
// Created by sid on 11/08/14.
// Copyright (c) 2014 Sergio Martinez-Losa. All rights reserved.
//
import Foundation
# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'