Skip to content

Instantly share code, notes, and snippets.

View FBSeletronica's full-sized avatar
🎯
Work from home

Fábio Souza FBSeletronica

🎯
Work from home
View GitHub Profile
import serial
porta = "/dev/ttyACM0"
baud = 9600
arquivo = "logger.csv"
ser = serial.Serial(porta,baud)
ser.flushInput()
print("Abrindo Serial")
amostra = 10
// Adafruit IO Subscription Example
//
// Adafruit invests time and resources providing this open source code.
// Please support Adafruit and open source hardware by purchasing
// products from Adafruit!
//
// Written by Todd Treece for Adafruit Industries
// Copyright (c) 2016 Adafruit Industries
// Licensed under the MIT license.
//
@FBSeletronica
FBSeletronica / webserveESP9266.ino
Created October 31, 2020 22:19
ExemplowebserverESP8266
#include <ESP8266WiFi.h>
const byte LAMP1 = 16;
const byte LAMP2 = 5;
const byte LAMP3 = 4;
const byte LAMP4 = 0;
const byte LAMP5 = 2;
const byte LAMP6 = 14;
const byte LAMP7 = 12;
const byte LAMP8 = 13;
@FBSeletronica
FBSeletronica / testeLCDKeypadShield.ino
Created August 30, 2020 20:04
Exemplo para testar LDC keypad Shield da DFRobot
//Teste LCD Keypad Shield
//Por Fábio Souza
// biblioteca para LCD
#include <LiquidCrystal.h>
//Instancia do LCD
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
@FBSeletronica
FBSeletronica / contador.c
Last active May 25, 2020 20:56
Contador simples de 2 digitos. Exemplo para uso de I/Os no AVR
/****************************************************
Contador simples de 2 digitos
Exemplo para uso de I/Os no AVR
****************************************************/
#include <avr/io.h>
#include <util/delay.h>
// MACROS
#define setBit(valor,bit) (valor |= (1<<bit))
#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
int errorLED = 13;
String ssid = "Simulator Wifi"; // Nome da rede wifi simulada
String password = ""; //o simulador de wifi nao tem uma senha
String host = "api.thingspeak.com"; // Thingspeak API
const int httpPort = 80; //porta http
// Define os pinos utilizados na comunicação com o ESP8266
#define PINO_ESP8266_RESET 7 // Inicializa o ESP8266
#define PINO_ESP8266_ATIVAR 8 // Ativa o ESP8266
#define ESP8266_RESET LOW
#define ESP8266_ATIVAR HIGH
#define ESP8266_BAUDRATE 115200
void setup()
/*
Exemplo para escrita em display de 7 segmentos
*/
//definição dos pinos
#define A 2
#define B 3
#define C 4
@FBSeletronica
FBSeletronica / mqtt_lamp.ino
Created June 19, 2019 19:45
Acionamento de 2 Lampadas com MQTT - Código para Ailton Mota
//Acionamento de 2 lampada e leitura do DHT11 com MQTT Dash
//Por: Fábio Souza
//Data: 19/06/19
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include "DHT.h"
#define INTERVALO_ENVIO_DHT 20000
@FBSeletronica
FBSeletronica / webserver_LED_CSS.ino
Created January 19, 2019 15:36
Exemplo: Web Server - Entrada e Saida Digital - Faz a o acionamento de Saida digital através de botão em página HTML com CSS e a Leitura do estado de uma entrada Digital
/*
* Curso - Controle dispositivos remotamente com ESP8266
* Por: Fábio Souza
*
* Web Server - Entrada e Saida Digital
* Faz a o acionamento de Saida digital através de botão em página HTML com CSS e a Leitura do estado de uma entrada Digital
*/
#include <ESP8266WiFi.h>