Skip to content

Instantly share code, notes, and snippets.

View rat's full-sized avatar
🏠
Working from home

Renato Tavares rat

🏠
Working from home
View GitHub Profile
#include <SPI.h>
#include <SD.h>
#include <Wire.h>
#include "RTClib.h"
/* Ciclos de trabalho */
#define CYCLE_1S 1000UL
#define CYCLE_5S 5000UL
#define CYCLE_30S 30000UL
#define CYCLE_60S 60000UL
#include <Wire.h>
#include "RTClib.h"
unsigned long CYCLE_1H = 3600000;
unsigned long transmissionLastMillis = 0;
unsigned long cycle_corrigido = 0;
RTC_DS1307 rtc;
AT+RST
AT+CIOBAUD=115600
AT+CIPMUX=0
AT+CWJAP="quario","12345678"
AT+CIPSTART="TCP","191.33.177.44",80
AT+CIPSEND=69
GET /teste.php?apples=56&oranges=23 HTTP/1.1
Host: 192.168.0.8
AT+CIPCLOSE
@rat
rat / sd.ino
Created October 18, 2015 18:00
#include <SPI.h>
#include <SD.h>
typedef struct {
int id;
float year;
} Log;
Log w, r;
@rat
rat / ds.md
Last active October 4, 2015 03:06

cURL

Classe cURL simples e leve, objetivada para facilitar integração com API's. Para outras informações sobre o cURL visite [documentação do PHP][1]

Instalação

Clique no botão de [download][2] ou clone esse repositório usando o comando git clone https://github.com/renatotavares/curl.git

Uso

@rat
rat / fav.txt
Last active September 1, 2015 14:24
http://www.lammertbies.nl/comm/info/ascii-characters.html#data
http://go.farmbot.it/
http://farmhack.org/app/
http://www.globalstar.com/en/
http://www.meteocercal.info/forum/Thread-Medindo-a-Radiacao-Solar-com-base-em-Celulas-Fotovoltaicas
http://www.isobus.org.br/index.php?option=com_content&view=article&id=51&Itemid=2
http://oco-carbon.com/weather/access.html
http://slashnode.com/pdo-for-elegant-php-database-access/
http://culttt.com/2012/10/01/roll-your-own-pdo-php-class/
http://lista.mercadolivre.com.br/sma-conector
#Servidor de desenvolvimento
sudo apt-get install apache2 -y &&
sudo a2enmod rewrite &&
sudo service apache2 restart &&
sudo apt-get install mysql-server php5-mysql -y &&
sudo mysql_install_db &&
sudo /usr/bin/mysql_secure_installation &&
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-curl php5-dev php-pear -y &&
Concorrentes
http://www.climaonline.com.br/dria/sig/
http://anovatec.com.br/home.html
http://www.climaonline.com.br/dria/shg/#
http://www.squitter.com.br/
/* Includes de bibliotecas de terceiros */
#include <SFE_BMP180.h>
#include <Ethernet.h>
#include <OneWire.h>
#include <RTClib.h>
#include <Wire.h>
#include <DHT.h>
#include <SPI.h>
#include <SD.h>
void sendDataEthernet() {
if(!SD.exists("db.txt")) return; // Arquivo não existe
db = SD.open("db.txt");
if(!db) return; // Erro ao abir o arquivo
char temp[50];
unsigned char save = 0, newLine = 0, i = 0, needle = 0;