#include "Arduino.h"
#include <Wire.h> // requried to run I2C SH1106
#include <SPI.h> // requried to run I2C SH1106
#include <Adafruit_GFX.h> // https://github.com/adafruit/Adafruit-GFX-Library
#include <Adafruit_SSD1306.h> // https://github.com/wonho-maker/Adafruit_SH1106
const int pinoA = A1;
int valorbase;
int novovalor;
int valorMax;
int valorMin;
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET 20 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
//********************************************
#define BRANCO_VERDE 2
#define VERDE 3
#define BRANCO_LARANJA 4
#define AZUL 5
#define BRANCO_AZUL 6
#define LARANJA 7
#define BRANCO_MARRON 8
#define MARRON 9
#define pinLed 10
#define pinBotao 12
#define pinBotao2 11
const int buzzer = A3;
unsigned long delay1 = 0;
int piscaTime = 0;
int pausa = 0;
int ledTime = 0;
bool led = HIGH;
int botao1;
int botao2;
int botao3;
int botaoAnt = HIGH;
int botao2Ant = HIGH;
int botao3Ant = HIGH;
int estadoPlay = 0;
float volts = 0.0;
int a1;
int a2;
float nivel;
int estadoPlayAnt = 1;
int menu = 0;
int visor = 0;
int escolha = 0;
int caboA;
int caboB;
int x;
bool comparador;
int tempo = 300;
int tp = 0;
static const unsigned char n1 = 1;
static const unsigned char n2 = 2;
static const unsigned char n3 = 3;
static const unsigned char n4 = 4;
static const unsigned char n5 = 5;
static const unsigned char n6 = 6;
static const unsigned char n7 = 7;
static const unsigned char n8 = 8;
String fio_bVD;
String fio_VD;
String fio_bLJ;
String fio_AZ;
String fio_bAZ;
String fio_LJ;
String fio_bMR;
String fio_MR;
String fio1;
String fio2;
String fio3;
String fio4;
String fio5;
String fio6;
String fio7;
String fio8;
static const unsigned char PROGMEM ConectorRj45 [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xF0, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xF8, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF8, 0x07, 0xF8, 0x00, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF8, 0x07, 0xF8, 0x01, 0xC9, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x01, 0xF8, 0x03, 0xD2, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x01, 0xF8, 0x07, 0xE4, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x18, 0x0F, 0xC9, 0x20, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x18, 0x1F, 0x82, 0x40, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x18, 0x3F, 0x14, 0x90, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x18, 0x7E, 0x39, 0x24, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x18, 0xFC, 0x7C, 0x48, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x1A, 0x78, 0xFE, 0x91, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x55, 0x55, 0x17, 0x39, 0xFF, 0x22, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x55, 0x55, 0x0F, 0x91, 0xFE, 0x05, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xF6, 0x55, 0x55, 0x1F, 0xC1, 0xFC, 0x7E, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0xF6, 0x55, 0x55, 0x3F, 0xE3, 0xF8, 0xF4, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0xE6, 0x55, 0x55, 0x3F, 0xE7, 0xF1, 0xF8, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x07, 0xC7, 0xFF, 0xFF, 0xBF, 0xCF, 0x03, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0F, 0x87, 0xFF, 0xFF, 0x7F, 0x9E, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1F, 0x03, 0xFF, 0xFE, 0x7F, 0x1C, 0x7F, 0xC0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x01, 0x1F, 0x38, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x03, 0x8F, 0x93, 0x9F, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x01, 0xC7, 0xC7, 0xCE, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x04, 0xE7, 0xEF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x0E, 0x7F, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x07, 0x3F, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x13, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x39, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x1D, 0xFF, 0x9F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x8F, 0xFF, 0x8F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x01, 0xC7, 0xFF, 0xC7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0xE7, 0xFC, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x7F, 0xFE, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x3F, 0xE7, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x3F, 0xF3, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x7F, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0xF0, 0x01, 0xFF, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0xFC, 0x07, 0xFF, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFC, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xF8, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
static const unsigned char PROGMEM CaboRj45 [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFC, 0x00, 0x1F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFE, 0x00, 0x10, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xE0, 0x10, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x20, 0x10, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x20, 0x1F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0xAA, 0xA0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0xAA, 0xA0, 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0xAA, 0xA0, 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0xAA, 0xA3, 0xF8, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0xAA, 0xA2, 0x08, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0xAA, 0xA2, 0x08, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x22, 0x08, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x23, 0xF8, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0xFF, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0xFF, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0xFF, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x21, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x2F, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x3C, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x70, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xC0, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0xFF, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0xFF, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0xFE, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0xFC, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0C, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x18, 0x7F, 0xFF, 0xF0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xF8, 0x7F, 0xFF, 0xF0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x60, 0x00, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x6A, 0xAA, 0xB0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x6A, 0xAA, 0xB0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x6A, 0xAA, 0xB0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x60, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F, 0xFF, 0xF0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F, 0xFF, 0xF0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F, 0xFF, 0xF0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F, 0xFF, 0xF0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F, 0xFF, 0xF0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x07, 0xFF, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x07, 0xFF, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x01, 0xFC, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x01, 0xFC, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF9, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xC0, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x70, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x1C, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x07, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// VU meter background mask image:
static const unsigned char PROGMEM Voltimetro[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x20, 0x04, 0x01, 0x00, 0x40, 0x04, 0x00, 0x00, 0x07, 0x70, 0x0C,
0xC0, 0x07, 0x00, 0x01, 0x00, 0x20, 0x04, 0x01, 0x00, 0x40, 0x04, 0x02, 0x00, 0x04, 0x50, 0x0C,
0xC0, 0x05, 0x00, 0x00, 0x80, 0x10, 0x3F, 0xFF, 0xFF, 0xE0, 0x08, 0x02, 0x00, 0x07, 0x50, 0x0C,
0xC0, 0x05, 0x01, 0x00, 0x80, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0x08, 0x02, 0x00, 0x01, 0x50, 0x0C,
0xC0, 0x05, 0x00, 0x80, 0x40, 0xFC, 0x80, 0x20, 0x08, 0x01, 0xF8, 0x06, 0x02, 0x07, 0x70, 0x0C,
0xC0, 0x07, 0x00, 0x80, 0x5F, 0x00, 0x80, 0x20, 0x08, 0x01, 0x07, 0xC4, 0x02, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x45, 0xE2, 0x00, 0x40, 0x20, 0x08, 0x02, 0x00, 0x7C, 0x04, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x80, 0x6E, 0x02, 0x00, 0x40, 0x00, 0x00, 0x02, 0x00, 0x83, 0x84, 0x04, 0x00, 0x0C,
0xC0, 0x00, 0x40, 0x72, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x78, 0x08, 0x00, 0x0C,
0xC0, 0x00, 0x21, 0x81, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8C, 0x10, 0x00, 0x0C,
0xC0, 0x00, 0x3F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0xA0, 0x00, 0x0C,
0xC0, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xC0, 0x00, 0x0C,
0xC0, 0x00, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x30, 0x00, 0x0C,
0xC0, 0x01, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0C, 0x00, 0x0C,
0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0C,
0xC0, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x82, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x0C,
0xC0, 0x18, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0C, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x98, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xC0, 0x00, 0x00, 0x00, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x0C,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC
};
void setup() {
Serial.begin(9600); //Inicializa a porta serial
//configuracao das portas digitais
pinMode(BRANCO_VERDE,OUTPUT);
pinMode(VERDE,OUTPUT);
pinMode(BRANCO_LARANJA,OUTPUT);
pinMode(AZUL,OUTPUT);
pinMode(BRANCO_AZUL,OUTPUT);
pinMode(LARANJA,OUTPUT);
pinMode(BRANCO_MARRON,OUTPUT);
pinMode(MARRON,OUTPUT);
pinMode(pinLed, OUTPUT);
pinMode(pinBotao, INPUT_PULLUP);
pinMode(pinBotao2, INPUT_PULLUP);
pinMode(buzzer, OUTPUT);
for (x = BRANCO_VERDE; x <= MARRON; x += 1)
{
digitalWrite(x, LOW);
}
// ****** INICIA O LCD ******
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // needed for SH1106 display
display.clearDisplay(); // Limpa o Display OLED
//display.setFont(&FreeSans9pt7b);
display.display(); // Carrega as informações no Display OLED
}
void loop() {
//valorX = map(analogRead(pinoA), 0, 1023, 0, 500);
valorbase = analogRead(pinoA); //0
for ( int x = 0; x <= 1000; x++) {
valorMax = analogRead(pinoA); //10
if(valorbase > (valorMax + 100)){valorbase = valorMax;}
if(valorbase < (100 - valorMax)){valorbase = valorMax;}
if(valorbase == valorMax){valorbase = valorMax;}
}
PiscaPisca();
//if(menu != 0){
// noTone(buzzer);
//}
botao1 = digitalRead(pinBotao);
//MENUS *********
switch(menu){
case 0:
TelaInicial();
break;
case 1:
testeCabo2();
break;
case 2:
testeCabo();
break;
}
//Serial.println (tp);
} //END LOOP
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
void TelaInicial(){
botao1 = digitalRead(pinBotao);
if (botao1 == LOW && botao1 != botaoAnt){
botaoAnt = !botaoAnt;
menu = 1;
}
botaoAnt = botao1;
display.clearDisplay(); //limpa o display OLED
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,0); //Coluna, Linha
display.print(F("TESTADOR DE CABO RJ45"));
display.drawBitmap(0, 0, ConectorRj45, 128, 64, WHITE);
if(piscaTime < 10){
display.setCursor(25,56); //Coluna, Linha
display.print(F("PRESS BUTTON"));
}
if(piscaTime > 10){
display.setCursor(54,25); //Coluna, Linha
display.print(F(" "));
}
display.display();
}
void testeCabo(){
fio_bVD = "X";
fio_VD = "X";
fio_bLJ = "X";
fio_AZ = "X";
fio_bAZ = "X";
fio_LJ = "X";
fio_bMR = "X";
fio_MR = "X";
display.clearDisplay();
display.setTextSize(2);
display.setCursor(20,25);
display.print(F("Aguarde"));
display.display();
pausa = 0;
caboA = BRANCO_VERDE;//pino 2
for (caboA = BRANCO_VERDE; caboA <= MARRON; caboA += 1) //Laço 1
{
pinMode(caboA, INPUT_PULLUP);
delay(50);
comparador = digitalRead(caboA);
delay(50);
if(comparador == false){
if(caboA == 2){
fio_bVD = "OK";
}
if(caboA == 3){
fio_VD = "OK";
}
if(caboA == 4){
fio_bLJ = "OK";
}
if(caboA == 5){
fio_AZ = "OK";
}
if(caboA == 6){
fio_bAZ = "OK";
}
if(caboA == 7){
fio_LJ = "OK";
}
if(caboA == 8){
fio_bMR = "OK";
}
if(caboA == 9){
fio_MR = "OK";
}
}
pinMode(caboA, OUTPUT);
digitalWrite(caboA, LOW);
}//END LAÇO *****
//EXIBE O RESULTADO NA TELA ***************************
while(pausa == 0){
display.clearDisplay(); //limpa o display OLED
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(18,0); //Coluna, Linha
display.print(F("A B"));
display.setTextSize(1);
display.setCursor(5,15);
display.print(n1);
display.setCursor(15,15);
display.print(fio_bVD);
display.setCursor(5,25);
display.print(n2);
display.setCursor(15,25);
display.print(fio_VD);
display.setCursor(5,35);
display.print(n3);
display.setCursor(15,35);
display.print(fio_bLJ);
display.setCursor(5,45);
display.print(n6);
display.setCursor(15,45);
display.print(fio_LJ);
display.setCursor(115,15);
display.print(n4);
display.setCursor(100,15);
display.print(fio_AZ);
display.setCursor(115,25);
display.print(n5);
display.setCursor(100,25);
display.print(fio_bAZ);
display.setCursor(115,35);
display.print(n7);
display.setCursor(100,35);
display.print(fio_bMR);
display.setCursor(115,45);
display.print(n8);
display.setCursor(100,45);
display.print(fio_MR);
display.drawBitmap(0, 0, CaboRj45, 128, 64, WHITE); //CaboRj45
display.display();
botao1 = digitalRead(pinBotao);
if (botao1 == LOW && botao1 != botaoAnt){
menu = 1;
botaoAnt = !botaoAnt;
pausa = 1;
break;
}
botaoAnt = botao1;
botao2 = digitalRead(pinBotao2);
if (botao2 == LOW && botao2 != botao2Ant){
pausa = 1;
botao2Ant = !botao2Ant;
}
botao2Ant = botao2;
PiscaPisca();
}//END WHILE PAUSA ************
}//END Void testeCabo ****************************
void testeCabo2(){
fio_bVD = " ";
fio_VD = " ";
fio_bLJ = " ";
fio_AZ = " ";
fio_bAZ = " ";
fio_LJ = " ";
fio_bMR = " ";
fio_MR = " ";
fio1 = " ";
fio2 = " ";
fio3 = " ";
fio4 = " ";
fio5 = " ";
fio6 = " ";
fio7 = " ";
fio8 = " ";
caboA = BRANCO_VERDE;//pino 2
for (caboA = BRANCO_VERDE; caboA <= 10; caboA += 1) //Laço 1
{
pinMode(caboA, INPUT_PULLUP);
delay(30);
comparador = digitalRead(caboA);
delay(30);
tone(buzzer, 1000);
if(comparador == false){
if(caboA == 2){
fio1 = ".";
fio_bVD = char(2);
fio_bMR = " ";
}
if(caboA == 3){
fio2 = ".";
fio_VD = char(2);
fio_bVD = " ";
}
if(caboA == 4){
fio3 = ".";
fio_bLJ = char(2);
fio_VD = " ";
}
if(caboA == 5){
fio4 = ".";
fio_AZ = char(2);
fio_bLJ = " ";
}
if(caboA == 6){
fio5 = ".";
fio_bAZ = char(2);
fio_AZ = " ";
}
if(caboA == 7){
fio6 = ".";
fio_LJ = char(2);
fio_bAZ = " ";
}
if(caboA == 8){
fio7 = ".";
fio_bMR = char(2);
fio_LJ = " ";
}
if(caboA == 9){
fio8 = ".";
fio_MR = char(2);
fio_bMR = " ";
}
}
if(comparador == true){
fio_bVD = " ";
fio_VD = " ";
fio_bLJ = " ";
fio_AZ = " ";
fio_bAZ = " ";
fio_LJ = " ";
fio_bMR = " ";
fio_MR = " ";
}
pinMode(caboA, OUTPUT);
digitalWrite(caboA, LOW);
led = !led;
digitalWrite(pinLed, led);
//EXIBE O RESULTADO NA TELA ********************************
display.clearDisplay(); //limpa o display OLED
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(5,0); //Coluna, Linha
display.print(F("TESTE DE CABO RJ45"));
display.setTextSize(2);
display.setCursor(0,48);
display.print(n1);
display.setCursor(0,25);
display.print(fio_bVD);
display.setCursor(0,25);
display.print(fio1);
display.setCursor(15,48);
display.print(n2);
display.setCursor(15,25);
display.print(fio_VD);
display.setCursor(15,25);
display.print(fio2);
display.setCursor(30,48);
display.print(n3);
display.setCursor(30,25);
display.print(fio_bLJ);
display.setCursor(30,25);
display.print(fio3);
display.setCursor(45,48);
display.print(n4);
display.setCursor(45,25);
display.print(fio_AZ);
display.setCursor(45,25);
display.print(fio4);
display.setCursor(60,48);
display.print(n5);
display.setCursor(60,25);
display.print(fio_bAZ);
display.setCursor(60,25);
display.print(fio5);
display.setCursor(75,48);
display.print(n6);
display.setCursor(75,25);
display.print(fio_LJ);
display.setCursor(75,25);
display.print(fio6);
display.setCursor(90,48);
display.print(n7);
display.setCursor(90,25);
display.print(fio_bMR);
display.setCursor(90,25);
display.print(fio7);
display.setCursor(105,48);
display.print(n8);
display.setCursor(105,25);
display.print(fio_MR);
display.setCursor(105,25);
display.print(fio8);
display.display();
botao1 = digitalRead(pinBotao);
if (botao1 == LOW && botao1 != botaoAnt){
botaoAnt = !botaoAnt;
tp = 0;
menu = 2;
break;
}
botaoAnt = botao1;
botao2 = digitalRead(pinBotao2);
if (botao2 == LOW && botao2 != botao2Ant){
tp = !tp;
botao2Ant = !botao2Ant;
}
botao2Ant = botao2;
if (tp == 1){
tempo = 50;
}
if (tp == 0){
tempo = 300;
}
led = !led;
digitalWrite(pinLed, led);
delay(tempo);
noTone(buzzer);
}//END LAÇO ******
}//END Void testeCabo
void PiscaPisca(){
if((millis() - delay1) > 100){
delay1 = millis();
piscaTime = piscaTime + 1;
ledTime = ledTime + 5;
estadoPlay = estadoPlay + 1;
}
if(estadoPlay == 10){
estadoPlay = 0;
estadoPlayAnt = 1;
}
if(ledTime <= 10){
led = HIGH;
}
if(ledTime > 10){
led = LOW;
}
digitalWrite(pinLed, led);
if(piscaTime > 20){
piscaTime = 0;
}
if(ledTime > 20){
ledTime = 0;
}
}// END Void PiscaPisca **************Loading
ssd1306
ssd1306