This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// --- Bibliotecas Auxiliares --- | |
//LCD CONFIGURACAO E TECLADO 4X4, SENSOR DISTANCIA | |
#include <Ultrasonic.h> | |
#include <Keypad.h> | |
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x027,2,1,0,4,5,6,7,3, POSITIVE); | |
//TECLADO DE 4X4, USANDO MATRIZ PARA IDENTIFICAR BOTAO PRESSINADO | |
const byte LINHAS = 4; //número de linhas do teclado | |
const byte COLUNAS = 4; //número de colunas do teclado | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SimpleModbusSlave.h> | |
#include <Ultrasonic.h> | |
#define pino_trigger 10 | |
#define pino_echo 11 | |
Ultrasonic ultrasom(pino_trigger, pino_echo); | |
enum | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SimpleModbusSlave.h> // inicia a chamada da bliblioteca para comunicao drive MODBUS | |
enum | |
{ | |
LED_1,//tag 1 | |
LED_2,//tag 2 | |
LED_3,//tag 3 | |
CHECK_1, | |
CHECK_2, | |
CHECK_3, | |
BARRA_POT, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SimpleModbusSlave.h> // inicia a chamada da bliblioteca para comunicao drive MODBUS | |
// | |
enum | |
{ | |
// basta adicionar ou remover registros e seu bem para ir para SCADA , | |
// primeiro registro começa no endereço 0, alteres os valres no P4 na tags | |
// depdendendo quantidade de variaveis "containes" ira levar o SCADA | |
BOTAO_VAL, | |
LED_IN, | |
LED_STATUS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Ultrasonic.h> | |
#include <Servo.h> | |
#define pino_trigger 4 //define pino trigger no 4 | |
#define pino_echo 5 //define pino echo no 5 | |
Servo myservo; // cria variavel para controle do servo motor. | |
Ultrasonic ultrasom(pino_trigger, pino_echo); | |
double error, setPoint ,valor , alturaTanque, controlePWM, lerCM , valorAnteriorCM, PID, trueNivel, angulo; | |
long tempoDerivada = 0 , tempo = 0, tempo1 = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Ultrasonic.h> //chama biblioteca | |
#include <Servo.h> //chama biblioteca | |
#define pino_trigger 4 //define pino trigger no 4 | |
#define pino_echo 5 //define pino echo no 5 | |
Servo myservo; // cria variavel para controle do servo motor. | |
Ultrasonic ultrasom(pino_trigger, pino_echo); | |
float error, setPoint ,valor , alturaTanque, controlePWM, lerCM , valorAnteriorCM, PID, trueNivel; | |
long tempoDerivada = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Ultrasonic.h> | |
#include <Servo.h> | |
#define pino_trigger 4 //define pino trigger no 4 | |
#define pino_echo 5 //define pino echo no 5 | |
Servo myservo; // cria variavel para controle do servo motor. | |
Ultrasonic ultrasom(pino_trigger, pino_echo); | |
///////////////////////////////// | |
// INICIALIZAÇÃO DAS VARIÁVEIS // | |
///////////////////////////////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Definindo os pinos do sensor de distancia! | |
#define echoPin 7 //Pino 13 recebe o pulso do echo | |
#define trigPin 6 //Pino 12 envia o pulso para gerar o echo | |
#define potenciometro A0 // potenciomentro no local analogico | |
//botao varivaveis | |
const int ledsom = 13; | |
const int botaoPino1 = 8; | |
const int ledVerde = 2; | |
const int ledVermelho = 4; | |
const int ledAmarelo = 3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Definindo os pinos do sensor de distancia! | |
#define echoPin 7 //Pino 13 recebe o pulso do echo | |
#define trigPin 6 //Pino 12 envia o pulso para gerar o echo | |
//botao varivaveis | |
const int botaoPino1 = 8; | |
const int ledVerde = 2; | |
const int ledVermelho = 4; | |
const int ledAmarelo = 3; |