Skip to content

Instantly share code, notes, and snippets.

View dansku's full-sized avatar
🌮
Focusing on tacos

Daniel Andrade dansku

🌮
Focusing on tacos
View GitHub Profile
@dansku
dansku / ultrasonic.ino
Created May 31, 2013 06:04
Ultrasonic Range Finder with Arduino
/*
@ Code for interfacing arduino with a Maxbotix LV-EZ4 Ultrasonic Range Finder
@ Code by Daniel Spillere Andrade
@ www.danielandrade.net -=- daniel@danielandrade.net
*/
int blinkLed=13; // Where the led will blink
@dansku
dansku / arduino-binary-clock.ino
Last active September 23, 2023 12:33
arduino binary clock
/*
An open-source binary clock for Arduino.
Based on the code from by Rob Faludi (http://www.faludi.com)
Code under (cc) by Daniel Spillere Andrade, www.danielandrade.net
http://creativecommons.org/license/cc-gpl
*/
int second=0, minute=0, hour=0; //start the time on 00:00:00
int munit,hunit,valm=0,valh=0,ledstats,i;
@dansku
dansku / arduino_sound_sensor.ino
Created June 7, 2013 11:02
Arduino Sound Sensor Example
/*
This is the code to make a LED blink with the music.
You have to set the threshold so it' sensible enough to make the led blink.
You connect an LED to PIN13 and the Sound Sensor to Analog Pin 0
*/
int led = 13;
int threshold = 500; //Change This
int volume;
@dansku
dansku / statcounter_scraper.py
Last active December 18, 2015 05:39
Statcounter doesnt have a API or a way to retrieve stats information, so this is a scraper to get the info from the page... Still need a lot of development!
import cookielib
import urllib
import urllib2
from BeautifulSoup import BeautifulSoup
import re
import time
#----[CONFIGURE]---------------------------------------------------------------------#
#
# Change HERE!
#include <SPI.h>
#include <dht.h>
dht DHT;
#define DHT22_PIN 8
#include <DS1307RTC.h>
#include <Time.h>
#include <Wire.h>
#include <LiquidCrystal.h>
@dansku
dansku / bitcasa_upload.py
Last active December 20, 2015 19:39
Organizing Pictures from BitCasa Upload Folder
# Organize Iphone Photos by Year -> Month
# August, 08, 2013 - Daniel Spillere Andrade
# www.DanielAndrade.net
import os, time
import glob
#Define Pictures Folder
folder = '/Volumes/Bitcasa Infinite Drive/Uploads/'
@dansku
dansku / dropboxCameraFolder.py
Created August 20, 2013 16:44
Organize Dropbox Camera Upload Folder
import os, time
import glob
#Define Pictures Folder
folder = '/Users/admin/Dropbox/Camera Uploads/'
fileFormats = ['JPG','jpg', 'MOV', 'mov', 'PNG', 'png', 'mp4', 'MP4'];
months = ['January','February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
picPath = []
@dansku
dansku / smsSenderFlask.py
Created August 28, 2013 23:20
Send message via Python Flask
import time
import pygsm
from flask import Flask
app = Flask(__name__)
app.config['DEBUG'] = False
@app.route('/')
def hello_world():
return 'Hey bitch!'
@dansku
dansku / bitcoin_litecoin_price.py
Created September 4, 2013 19:55
Get Bitcoin & Litecoin Price in Python
import urllib2, json
BTC = json.loads(urllib2.urlopen('https://mtgox.com/api/1/BTCUSD/ticker').read())
btcAtual = BTC['return']['last']['value']
btcHigh = BTC['return']['high']['value']
btcLow = BTC['return']['low']['value']
LTC = json.loads(urllib2.urlopen('https://btc-e.com/api/2/ltc_usd/ticker').read())
@dansku
dansku / button-ino.ino
Created September 16, 2013 21:29
arduino button light
/*
Botao Tarrafa - Presenca
www.Tarrafa.net
*/
#include <EEPROM.h>
#define memory 0 // Memoria
#define bPin 2 // Pino do botao
#define led A0 // Led do botao