This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*------------------------------------------------------------------------------------------------------------------------ | |
Open Hardware Mood Lamp | |
By: Daniel Spillere Andrade - www.DanielAndrade.net - [email protected] - https://github.com/dansku | |
https://github.com/dansku/Open-Hardware-Mood-Lamp | |
Based on the code from Arkadian: http://www.arkadian.eu/pages/219/arduino-controlled-ikea-lamp | |
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License. | |
Code version: 0.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*------------------------------------------------------------------------------------------------------------------------ | |
Open Hardware Mood Lamp | |
By: Daniel Spillere Andrade - www.DanielAndrade.net - [email protected] - https://github.com/dansku | |
https://github.com/dansku/Open-Hardware-Mood-Lamp | |
Based on the code from Arkadian: http://www.arkadian.eu/pages/219/arduino-controlled-ikea-lamp | |
This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License. | |
Code version: 0.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#----------------------------------------------------------------------------- | |
# Script to Backup all your photos from PicPlz | |
# | |
# Daniel Spillere Andrade - www.DanielAndrade.net | |
#----------------------------------------------------------------------------- | |
import urllib2 | |
import simplejson | |
import os | |
from datetime import datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import urllib2 | |
from bs4 import BeautifulSoup | |
import re | |
import time | |
#---[ Functions ]---# | |
def isTimeFormat(input): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function distance($lat1, $long1, $lat2, $long2) { | |
$R = 6371; // Earth Radius in Km | |
$dLat = deg2rad($lat2-$lat1); | |
$dLong = deg2rad($long2-$long1); | |
$lat1 = deg2rad($lat1); | |
$lat2 = deg2rad($lat2); | |
$a = sin($dLat/2)*sin($dLat/2) + sin($dLong/2)*sin($dLong/2)*cos($lat1)*cos($lat2); | |
$c = 2 * atan2(sqrt($a),sqrt(1-$a)); | |
$d = $R * $c; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def distance(lat1, long1, lat2, long2): | |
R = 6371 # Earth Radius in Km | |
dLat = math.radians(lat2 - lat1) # Convert Degrees 2 Radians | |
dLong = math.radians(long2 - long1) | |
lat1 = math.radians(lat1) | |
lat2 = math.radians(lat2) | |
a = math.sin(dLat/2) * math.sin(dLat/2) + math.sin(dLong/2) * math.sin(dLong/2) * math.cos(lat1) * math.cos(lat2) | |
c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
for filename in os.listdir("."): | |
if filename.endswith('_mini.jpg'): | |
mini = filename.find('_mini.jpg') | |
name = filename[:mini] + '.jpg' | |
os.rename(filename, name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
An open-source LM35DZ Temperature Sensor for Arduino. This project will be enhanced on a regular basis | |
(cc) by Daniel Spillere Andrade , http://www.danielandrade.net | |
http://creativecommons.org/license/cc-gpl | |
*/ | |
int pin = 0; // analog pin | |
int tempc = 0,tempf=0; // temperature variables | |
int samples[8]; // variables to make a better precision | |
int maxi = -100,mini = 100; // to start max/min temperature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@ Code for interfacing Alcohol Gas Sensor MQ-3 with Arduino | |
@ Code by Daniel Spillere Andrade and Daniel Amato Zabotti | |
@ [email protected] / [email protected] | |
@ www.DanielAndrade.net | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// temperature() | |
// Temperature Sensor + Clock - by Daniel Spillere Andrade - www.DanielAndrade.net | |
// Should Change the Temperature Only when minutes change, to prevent floating on temperature | |
// Based on http://www.danielandrade.net/2008/07/05/temperature-sensor-arduino/ - Daniel Spillere Andrade - daniel [a] danielandrade.net | |
void temperature(){ | |
ht1632_clear(); |
OlderNewer