Skip to content

Instantly share code, notes, and snippets.

View futureshocked's full-sized avatar

Peter Dalmaris futureshocked

View GitHub Profile
@futureshocked
futureshocked / Bash
Created June 12, 2010 22:23
This is an example on how to use MacRuby to read/write CoreData records. Tested with MacRuby 0.6 on Mac OS X 10.6.3.
$ /Developer/usr/bin/momc simpleTextMessageModel.xcdatamodel simpleTextMessageModel3.mom
@futureshocked
futureshocked / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@futureshocked
futureshocked / lab_env_db.html
Created April 20, 2015 03:00
lab_env_db.html Added timezone function
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Basic Page Needs
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta charset="utf-8">
<title>Lab Conditions by RPi</title>
<meta name="description" content="Lab conditions - RPi">
<meta name="author" content="Peter Dalmaris">
<!-- Mobile Specific Metas
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
int do_a_calc(int a, int b){
int c = a + b;
return c;
}
void setup() {
// put your setup code here, to run once:
int a = do_a_calc(1,2);
}
void loop() {
// put your main code here, to run repeatedly:
}
@futureshocked
futureshocked / buzer_pot.ino
Created August 16, 2015 00:58
A demo of controlling the loudness of a piezo buzzer with a potentiometer
/* FILE NAME
button.py
1. WHAT IT DOES
Reads the value of a potentiometer and controls the loudness of a piezo buzzer via pwm
2. ORIGINAL WORK
Raspberry Full stack 2015, Peter Dalmaris
3. HARDWARE
D11: piezo buzzer
@futureshocked
futureshocked / dc_motor_interval.ino
Created November 26, 2015 09:43
Moving the DC motor both directions, for an equal time interval each.
//Arduino PWM Speed Control:
int E1 = 5;
int M1 = 4;
void setup()
{
Serial.begin (9600);
pinMode(M1, OUTPUT);
}
/*##############################################################################
Author:
* Mirko Prosseda (06-2013)
* email: [email protected]
* Modified by Peter Dalmaris
Description:
* DC Dual Motor Driver 30V 4A V2 test sketch v1.0
* Speed and direction for each motor channel are regulated by
@futureshocked
futureshocked / tmp36.ino
Created December 12, 2015 07:13
Simple sketch for calculating temperature with the tmp36 (based on a sketch by Adafruit)
//TMP36 Pin Variables
int sensorPin = 0; //the analog pin the TMP36's Vout (sense) pin is connected to
//the resolution is 10 mV / degree centigrade with a
//500 mV offset to allow for negative temperatures
/*
* setup() - this function runs once when you turn your Arduino on
* We initialize the serial connection with the computer
*/
void setup()