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 / 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 / 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 / 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 / ml.parse.vb
Last active August 29, 2015 14:27
Percorre a fatura do ML procurando por roubos
Sub getTheRabit()
Dim i As Integer, j As Integer, k As Integer
Dim cuDate As String, newDate As String
Dim temp As String
With Worksheets("Report")
i = 16
Do Until .Cells(i, 2).Value = ""
k = 16
cuDate = .Cells(i, 2).Value
@tegila
tegila / sim800l.cpp
Last active October 15, 2015 01:34
SIM800L
/*
### Esquema de ligação ###
- Ligar o VCC do SIM800L a uma fonte +4V 2A estável
- Conectar o GND do SIM800L ao GND do Arduino e também ao GND da fonte.
> Todos alimentados agora podemos ligar a parte da comunicação serial
- Ligar o RX do SIM800L (ENTRADA) ao Digital 11 do Arduino
- Ligar o TX do SIM800L (SAIDA) ao Digital 10 do Arduino
## Utilização:
@tegila
tegila / Artnet.cpp
Last active November 11, 2015 21:33
/*The MIT License (MIT)
Copyright (c) 2014 Nathanaël Lécaudé
https://github.com/natcl/Artnet, http://forum.pjrc.com/threads/24688-Artnet-to-OctoWS2811
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@tegila
tegila / SDWebBrowser.cpp
Last active January 5, 2016 19:35
adafruit SDWebBrowser updated
/*
* USERS OF ARDUINO 0023 AND EARLIER: use the 'SDWebBrowse.pde' sketch...
* 'SDWebBrowse.ino' can be ignored.
* USERS OF ARDUINO 1.0 AND LATER: **DELETE** the 'SDWebBrowse.pde' sketch
* and use ONLY the 'SDWebBrowse.ino' file. By default, BOTH files will
* load when using the Sketchbook menu, and the .pde version will cause
* compiler errors in 1.0. Delete the .pde, then load the sketch.
*
* I can't explain WHY this is necessary, but something among the various
* libraries here appears to be wreaking inexplicable havoc with the
@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 / 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.