Skip to content

Instantly share code, notes, and snippets.

View tegila's full-sized avatar

Edson Tégila tegila

View GitHub Profile
@tegila
tegila / logger.cpp
Last active August 29, 2015 14:08
Projeto Jarduino - Controle de irrigação online com dados sobre a humidade do solo, temperatura do ar e iluminação diária
#include <Arduino.h>
#include "TimerOne.h"
#include <dht.h>
#include <SdFat.h>
#include <SdFatUtil.h> // define FreeRam()
#define DHT22_PIN 5
#define SD_CHIP_SELECT SS // SD chip select pin
@tegila
tegila / mt7601.sh
Created April 15, 2015 15:23
MediaTek MT7601 to Raspberry Pi 2 Raspbian
## Fetch source code from firmware and linux
git clone --depth 1 https://github.com/raspberrypi/firmware
git clone --depth=1 -b rpi-3.19.y --single-branch https://github.com/raspberrypi/linux
## Update firmware files
sudo mkdir /boot/backup
sudo cp /boot/* /boot/backup/
sudo cp -r firmware/modules /lib
sudo cp -r src/firmware/boot /
sudo cp firmware/extra/Module7.symvers linux/Module.symvers
@tegila
tegila / waveshare32b.md
Last active June 22, 2016 22:47
LCD WaveShare32b (ili9340) Raspberry Pi 2 Guide

Atualize sua placa

sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update

Adicione os parametros para ligar os pinos do SPI

# sudo nano /boot/config.txt
dtparam=spi=on
dtoverlay=ads7846,penirq=17,swapxy=1
@tegila
tegila / nginx_ssl.sh
Last active August 29, 2015 14:19
Nginx SSL Auth Setup
# Create the CA Key and Certificate for signing Client Certs
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
# Create the Server Key, CSR, and Certificate
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
# We're self signing our own server cert here. This is a no-no in production.
openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt
@tegila
tegila / rotary.encoder.KY-040.cpp
Created May 6, 2015 04:12
Rotary Encoder KY-040 from China - Sample Code
long virtualPosition=0;
#define PinCLK 2 // Used for generating interrupts using CLK signal
#define PinDT 3 // Used for reading DT signal
#define PinSW 4 // Used for the push button switc
void isr () {
noInterrupts();
if (digitalRead(PinCLK) == digitalRead(PinDT))
virtualPosition++;
@tegila
tegila / test.oled.cpp
Created May 28, 2015 14:11
Arduino OLED
/* OLED arduino
D0-----------10
D1-----------9
RST----------13
DC-----------11
VCC----------5V
GND----------GND*/
int SCL_PIN=10;//D0
int SDA_PIN=9; //D1
int RST_PIN=13;//RST
@tegila
tegila / tips.sh
Created May 31, 2015 20:54
Raspberry Pi GST+OPENCV
sudo modprobe bcm2835-v4l2
sudo apt-get install python2.7-dev
sudo apt-get install libopencv-dev python-opencv python-dev
sudo apt-get install python-picamera
@tegila
tegila / sim900.mdown
Last active November 2, 2023 09:55
SIM900 TIPS AND TRICKS

TUTORIAL

Attach to GPRS Service

-> AT+CGATT = 1
<- OK

Define PDP Context (cid, PDP type, APN)

-&gt; AT+CGDCONT=1,"IP","zap.vivo.com.br"
@tegila
tegila / arduino.s
Last active August 29, 2015 14:24
Arduino Assembly
/* avr-gcc -S file.c */
/* Write your program in a file filename. */
/* avr-as filename program.out */
/* avr-objcopy -j .text -j .data -O ihex program.out program.hex */
/*
int main(void) {
int i=0;
i = i+10;
return i;
@tegila
tegila / esp8266.md
Last active July 6, 2017 00:08
ESP8266 ESP-12

ESP8266

Dia 1 - Vos apresento a revolução no mundo IoT (Internet das Coisas)

As Coisas

Primeiramente vale dizer que o dispositivo é bastante instável e que as vezes não responde aos comandos nem dá sinal de vida fazendo parecer que está estragado. Porém com um pouco de insistência, consegui fazer o meu funcionar sem queimar nenhum. Mesmo tendo invertido o VCC(3.3v) e o GND algumas vezes. 😆

Na internet tem diversas advertências sobre não usar o ESP8266 diretamente no Arduino sem usar nenhuma Conversor de Nível Lógico de 3.3v (ESP8266) - 5v (Arduino). Isso me deixou um tanto apreensivo sobre a fragilidade e várias vezes pensei te-lo estragado.