Skip to content

Instantly share code, notes, and snippets.

View futureshocked's full-sized avatar

Peter Dalmaris futureshocked

View GitHub Profile
@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 / 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 / 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: mirko.prosseda@gmail.com
* 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()
@futureshocked
futureshocked / refs_vs_pointers.ino
Last active April 20, 2016 21:30
A sketch written to help people understand the use of references and pointers
/*
* ref_vs_pointers
* A sketch written to help people understand the use of references and pointers
* Written by Peter Dalmaris, April 8 2016.
* Arduino Tips and Tricks
* txplore.com
*
* Requirements: MemoryFree from https://github.com/McNeight/MemoryFree
*/