Skip to content

Instantly share code, notes, and snippets.

@eduardodx
eduardodx / cinit.sublime-snippet
Created April 6, 2012 16:25
Sublime Text 2 - C Basic Snippet
<snippet>
<content><![CDATA[
#include <stdio.h>
int main () {
$0
return 0;
}
@eduardodx
eduardodx / test.ino
Created January 27, 2012 19:37
Test
void setup() {
Wire.begin( 2 );
Wire.onRequest( requestEvent );
Wire.onReceive( receiveEvent );
}
void requestEvent(){
@eduardodx
eduardodx / ard_elevador_master.ino
Created January 27, 2012 18:37
Arduino - Elevador - Master
#include <Wire.h>
int botoesEstado[4], portasEstado[5], movimentacaoEstado[3], andar = 0;
int chamadasExternas[4], chamadasInternas[4], reqAbrir, reqFechar, emergencia = 0;
int listaPrincipal[4], listaEspera[4] = {0};
void setup () {
Wire.begin(); // Define como Master
@eduardodx
eduardodx / arduino_i2c_master.ino
Created January 26, 2012 23:21
Arduino - I2C Master
#include <LiquidCrystal.h>
#include <Wire.h>
int x, y, resposta = 0;
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
void setup() {
lcd.begin(16, 2);
lcd.home();
Wire.begin();// Inicia a comunicação I2C, o Master não precisa de endereço
@eduardodx
eduardodx / arduino_i2c_slave.ino
Created January 26, 2012 23:19
Arduino - I2C Slave
#include <LiquidCrystal.h>
#include <Wire.h>
int x, y, resposta = 0;
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
void setup() {
lcd.begin(16, 2);
lcd.home();
Wire.begin(2);// Inicia a comunicação I2c, e este arduino possui endereço 2
@eduardodx
eduardodx / gist:1618807
Created January 16, 2012 02:59 — forked from stammy/gist:1610222
some startups on tumblr (that should probably move off tumblr)
http://tumblr.everlane.com/
http://blog.hipmunk.com/
http://blog.shoplrapp.com/
http://blog.mailgun.net/
http://blog.grooveshark.com/
http://blog.path.com/
http://blog.instagram.com/
http://blog.oink.com/
http://blog.shelby.tv/
http://blog.roamz.com/
@eduardodx
eduardodx / arduino_relogio_despertador.pde
Created December 1, 2011 11:23
Arduino Relogio Despertador
#include <Wire.h>
int state;
byte SW0 = 3;
byte SW1 = 2;
byte SW2 = 1;
byte minutes;
byte hours;
@eduardodx
eduardodx / led_serial_0_255.pde
Created November 22, 2011 23:28
Led_Serial_0_255
char letra[4]={'a','b','c','d'};
int brilho [4]={0,80,160,255};
int stateLed=10;
int infoLed=9;
int info;
int flag = 0;
int resMaster = 0;
String number;
@eduardodx
eduardodx / arduino_simon_says.pde
Created November 9, 2011 23:01
Arduino - Simon Says
/**
* Arduino - Simon Says
* ELTN.4M - Douglas Antunes, Eduardo Souza, Joao Gabriel e Mateus Mahado
*/
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int rounds = 50;
@eduardodx
eduardodx / fibonacci_sequence.js
Created July 26, 2011 04:10
Fibonacci Sequence
function fibonacci(n) {
if( n == 0 || n == 1 ){
return n;
} else {
return fibonacci(n-1) + fibonacci(n-2);
}
}