sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update
# sudo nano /boot/config.txt
dtparam=spi=on
dtoverlay=ads7846,penirq=17,swapxy=1| #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 |
| ## 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 |
| # 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 |
| 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++; |
| /* 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 |
| 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 |
| /* 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; |
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.