I can't use the terminal in an external file

I have the main file (* .ino) and an external file (terminal.h / cpp) and I can’t print the external file to the terminal. Can someone help me?

I think we’d need to see your code to understand exactly what it is that you are trying to achieve and what it is that you’re doing wrong.

Pete.

I’m sorry, I’m new here. How do I post my code?

I can only send a message to the terminal but I cannot receive it. I tried to declare the variable as external but it gives error.

Paste it between triple backticks.
Triple backticks look like this:
```
Copy and paste these if you can’t find the correct character on the keyboard.

Pete.

This is my main file;

[Unformatted code removed by moderator]

I cannot post the other code (terminal.cpp). Please copy this and let me know so I can replace it with the second part of the code.

wait…

Why would you ask about how to post code, then ignore my instructions about triple backticks?

Pete.

Pete, I did as I asked, I put it on ‘’ 'but I didn’t notice a difference.
I’ll post with the ‘’ '.

Pete, should I post between two double quotes and a single quote or between three single quotes? Give an example so that I can understand better.

Neither - triple backticks.

I already did that.

Pete.

 Observações:
    Este projeto utiliza um teclado de membrana e displays 74hc595
    Utiliza-se também de terminal para alterar e visualizar parametros.
    A configuração do terminal deve ser:
        O terminal pode ser qualquer um, porém este foi testado no Putty.
        Baud Rate: 115200.
        BackSpace: ControlH
        Controle de fluxo: None (nenhum)
        Estudar o protocolo MQTT para Arduino (Blynk)
----------------------------------------------------------------------*/

#include "Arduino.h"
#include "global.h"
#include "Thread.h"
#include "ThreadController.h"
#include "Terminal.h"
#include "EEPROM.h"
#include "Modulo595.h"
#include "Keypad.h"
#include "key.h"
#include "Eeprom_Indka.h"
#include <stdlib.h>
#include "WiFi.h"
#include "WiFiClient.h"
#include "BlynkSimpleEsp32.h"
#define BLYNK_PRINT Serialb

//-------------------------------------------


Controladores SensoresAtuadores[MAXDEVICE];

uint32_t tempoDecorrido = 0;

int SCLK = 21; //Clock
int RCLK = 17; //Lath
int DIO = 16;  //Data

String blynkDisplay[MAXDEVICE];
Eeprom_Indka hardDisk = Eeprom_Indka();
Modulo595 seteSegmentos(SCLK, RCLK, DIO);
Terminal cmd;

char auth[] = "Pd9SZNodRX688FDh_kTitt-nOUkYIrnh";
char ssid[] = "Nera";
char pass[] = "iub950962";

WidgetTerminal terminalb(V5);
BlynkWifi Blynk;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//             T E C L A D O   D E   M E M B R A N A
const byte qtdLinhas = 4; //QUANTIDADE DE LINHAS DO TECLADO
const byte qtdColunas = 4; //QUANTIDADE DE COLUNAS DO TECLADO

//CONSTRUÇÃO DA MATRIZ DE CARACTERES
char matriz_teclas[qtdLinhas][qtdColunas] = {
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};

byte PinosqtdLinhas[qtdLinhas] = { 12 , 32, 25, 27 }; //PINOS UTILIZADOS PELAS LINHAS
byte PinosqtdColunas[qtdColunas] = { 26, 18, 19, 23 }; //PINOS UTILIZADOS PELAS COLUNAS

//INICIALIZAÇÃO DO TECLADO
Keypad meuteclado = Keypad(makeKeymap(matriz_teclas), PinosqtdLinhas, PinosqtdColunas, qtdLinhas, qtdColunas);
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


ThreadController controll = ThreadController();



//======================================================================
//                           T  H  R  E  A  D  S
//======================================================================
String bufferblk="";
boolean flag_rxb = false;
BLYNK_WRITE(V5) {
    bufferblk = param.asString();
    flag_rxb = true;
}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thread thBlynk;
void doBlynk() {
    static uint8_t escalona = 0;
    switch (escalona++)
    {
    case 0:Blynk.virtualWrite(V0, blynkDisplay[0]); break;
    case 1:Blynk.virtualWrite(V1, blynkDisplay[1]); break;
    case 2:Blynk.virtualWrite(V2, blynkDisplay[2]); break;
    case 3: escalona = 0; break;
    }
}


    //thBlynk.onRun(doBlynk);
    //thBlynk.setInterval(500);

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thread thDisplay;
void doDisplay(void) {
     Exibe_Display(1234);
}



//=====================================================================
//++++++++++++++++++++++
// TECLADO DE MEMBRANA
Thread thKeypad;
char tecla_pressionada = 0;
static int8_t displayNumero = -1;
static float decimal = 100.0;
static float temp = 0;
bool flag_zerar = true;
uint8_t funcao = FUNCAO_NONE;
int8_t autorestore = 0;
void doKeypad()
{
    tecla_pressionada = meuteclado.getKey();
    if (tecla_pressionada)
    {
        SaidaAutomatica(SETA); //Define desistência de edição
        switch (tecla_pressionada)
        {
        case 'A':Pressionou_a_Tecla_A(); break;
        case 'B':Pressionou_a_Tecla_B(); break;
        case 'C':Pressionou_a_Tecla_C(); break;
        case '*':Pressionou_Asterisco(); break;
        case 'D':Pressionou_a_Tecla_D(); break;
        case '#':Pressionou_Tecla_Sharp(); break;
        default:Pressionou_Tecla_Numerica(); break;
        }
        
    tecla_pressionada = 0;
    }
}

//=====================================================================
//++++++++++++++++++++++
//Relogio de tempo real
Thread thRTC = Thread();
void doRTC() {
    Gerenciador_de_Tempo();

}

//========================================================================
Thread thBlinkLed = Thread();
void doBlinkLed() {
    digitalWrite(LED_BLINK, !digitalRead(LED_BLINK));
}


//========================================================================
Thread thTerminal = Thread();
Terminal terminal;
void doTerminal() {
    terminal.interpretador();
}

// The setup() function runs once each time the micro-controller starts

void setup()
{


    delay(500);
    pinMode(LED_BLINK, OUTPUT);
    pinMode(2, OUTPUT);

    Serial.begin(115200);
    Blynk.begin(auth, ssid, pass);
    EEPROM.begin(1024);

    //---------------------------

    thBlynk.onRun(doBlynk);
    thBlynk.setInterval(500);

    thDisplay.onRun(doDisplay);
    thDisplay.setInterval(1);

    thKeypad.onRun(doKeypad);
    thKeypad.setInterval(16);

    thBlinkLed.onRun(doBlinkLed);
    thBlinkLed.setInterval(500);

    thTerminal.onRun(doTerminal);
    thTerminal.setInterval(16);

    thRTC.onRun(doRTC);
    thRTC.setInterval(1);

    controll.add(&thBlynk);
    controll.add(&thDisplay);  //Displays de sete segmentos
    controll.add(&thKeypad);   //Teclado de membrana
    controll.add(&thTerminal);//Terminal Putty
    controll.add(&thBlinkLed);//Pisca Led
    controll.add(&thRTC);       //RTC


    //-------APAGAR DEPOIS DE TESTES (FIX)----------
    SensoresAtuadores[VOLTIMETRO].value = 125.3;
    SensoresAtuadores[CONDENSADOR].value = -27.4;
    SensoresAtuadores[VACUOMETRO].value = 637.2;
    //----------------------------------------------

    for (uint8_t i = 0; i < MAXDEVICE; i++)
    {
        SensoresAtuadores[i].setpoint = hardDisk.EEPROMReadFloat(12 * i);
        SensoresAtuadores[i].histerese = hardDisk.EEPROMReadFloat(12 * i + 4);
        SensoresAtuadores[i].offset = hardDisk.EEPROMReadFloat(12 * i + 8);
        SensoresAtuadores[i].status = NORMAL;
    }
}

// Add the main program code into the continuous loop() function
void loop()
{
    controll.run();
    Blynk.run();
}















//oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
void Exibe_Display(uint16_t num) {
    int8_t counter;

    for (counter = 0; counter < MAXDEVICE; counter++)
        if ((funcao == FUNCAO_SETPOINT) || (funcao == FUNCAO_HISTERESE))
        {
            if (SensoresAtuadores[counter].status == DINAMICO)
            {
                if (tempoDecorrido > 0)
                {
                    seteSegmentos.sendDisplay(SensoresAtuadores[counter].mensagem, DINAMICO);
                    blynkDisplay[counter] = SensoresAtuadores[counter].mensagem;
                }
                else
                {
                    seteSegmentos.sendDisplay(SensoresAtuadores[counter].temp, PISCA);
                    blynkDisplay[counter] = "";
                    blynkDisplay[counter] += SensoresAtuadores[counter].temp;          
                }
            }
            else if (SensoresAtuadores[counter].status == NORMAL)
            {
                seteSegmentos.sendDisplay(SensoresAtuadores[counter].valor(COMPOSTO), NORMAL);
                blynkDisplay[counter] = "";
                blynkDisplay[counter] += SensoresAtuadores[counter].valor(COMPOSTO);
            }
            else if (SensoresAtuadores[counter].status == PISCA)
            {
                seteSegmentos.sendDisplay(SensoresAtuadores[counter].valor(COMPOSTO), PISCA);
                blynkDisplay[counter] = "";
                blynkDisplay[counter] += SensoresAtuadores[counter].valor(COMPOSTO);
            }
        }
        else if (funcao == FUNCAO_CODIGO)
        {
            if (SensoresAtuadores[counter].status == DINAMICO)
            {
                if (tempoDecorrido > 0)
                {
                    seteSegmentos.sendDisplay(SensoresAtuadores[counter].mensagem, DINAMICO);
                    blynkDisplay[counter] = SensoresAtuadores[counter].mensagem;
                }
                else
                {
                    seteSegmentos.sendDisplay(SensoresAtuadores[counter].temp, PISCA);
                    blynkDisplay[counter] = "";
                    blynkDisplay[counter] += SensoresAtuadores[counter].temp;
                }
            }
            else if (SensoresAtuadores[counter].status == NORMAL)
            {
                seteSegmentos.sendDisplay(SensoresAtuadores[counter].valor(COMPOSTO), NORMAL);
                blynkDisplay[counter] = "";
                blynkDisplay[counter] += SensoresAtuadores[counter].valor(COMPOSTO);
            }
            else if (SensoresAtuadores[counter].status == PISCA)
            {
                seteSegmentos.sendDisplay(SensoresAtuadores[counter].valor(COMPOSTO), PISCA);
                blynkDisplay[counter] = "";
                blynkDisplay[counter] += SensoresAtuadores[counter].valor(COMPOSTO);
            }
        }
        else if (funcao==FUNCAO_NONE)
                { 
                if(SensoresAtuadores[counter].status==DINAMICO)
                  { 
                  if(autorestore%2==0)
                    {
                    seteSegmentos.sendDisplay(SensoresAtuadores[counter].temp, NORMAL);
                    blynkDisplay[counter] = "";
                    blynkDisplay[counter] += SensoresAtuadores[counter].temp;
                    }
                  else
                    {
                    seteSegmentos.sendDisplay(SensoresAtuadores[counter].mensagem, NORMAL);
                    blynkDisplay[counter] = SensoresAtuadores[counter].mensagem;                    
                    }
                  }
                else
                  {
                  seteSegmentos.sendDisplay(SensoresAtuadores[counter].valor(COMPOSTO), NORMAL);
                  blynkDisplay[counter] = "";
                  blynkDisplay[counter] += SensoresAtuadores[counter].valor(COMPOSTO);                  
                  }
                }
        seteSegmentos.show();

}



//00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000









//oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
//RTC do Sistema
uint8_t  hora = 0;
uint8_t  minuto = 0;
uint8_t  segundo = 0;
uint16_t milisegundo = 0;
void Gerenciador_de_Tempo() {
    if (tempoDecorrido > 0) tempoDecorrido--;
    milisegundo++;
    if (milisegundo >= 1000)
    {
        milisegundo = 0;
        segundo++;
        SaidaAutomatica(MONITORA);
        if (segundo >= 60)
        {
            segundo = 0;
            minuto++;
            if (minuto >= 60)
            {
                minuto = 0;
                hora++;
                if (hora >= 24)
                {
                    hora++;
                }
            }

        }
    }
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//SetPoint do Sistema
void Pressionou_a_Tecla_A() {
    funcao = FUNCAO_SETPOINT;
    for (int8_t i = 0; i < MAXDEVICE; i++)
    {
        SensoresAtuadores[i].status = NORMAL;
        SensoresAtuadores[i].mensagem = "SET.P";
        SensoresAtuadores[i].temp = SensoresAtuadores[i].setpoint;
    }
    if (++displayNumero >= MAXDEVICE) displayNumero = 0;
    flag_zerar = true;

    SensoresAtuadores[displayNumero].status = DINAMICO;
    tempoDecorrido = 3000;
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//Histerese do sistema
void Pressionou_a_Tecla_B() {
    funcao = FUNCAO_HISTERESE;
    decimal = 0.01;
    for (int8_t i = 0; i < MAXDEVICE; i++)
    {
        SensoresAtuadores[i].status = NORMAL;
        SensoresAtuadores[i].mensagem = "HIST";
        SensoresAtuadores[i].temp = SensoresAtuadores[i].histerese;
    }
    if (++displayNumero >= MAXDEVICE) displayNumero = 0;       
    flag_zerar = true;
    SensoresAtuadores[displayNumero].status = DINAMICO;
    tempoDecorrido = 3000;
}

//====================================================================================
//Code do Sistema
void Pressionou_a_Tecla_C() {
    funcao = FUNCAO_CODIGO;
    decimal = 0.01;
    for (int8_t i = 0; i < MAXDEVICE; i++)
    {
        SensoresAtuadores[i].status = NORMAL;
        SensoresAtuadores[i].mensagem = "CODE";
        SensoresAtuadores[i].temp = 0;
    }    
    if (++displayNumero >= MAXDEVICE) displayNumero = 0;
    flag_zerar = true;
    SensoresAtuadores[displayNumero].status = DINAMICO;
    tempoDecorrido = 3000;
}


//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//Alterna entre positivo e negativo
void Pressionou_a_Tecla_D() {
    SensoresAtuadores[displayNumero].temp = -SensoresAtuadores[displayNumero].temp;
}



//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//Teclas Numericas
void Pressionou_Tecla_Numerica() {
     if((funcao==FUNCAO_SETPOINT)||(funcao==FUNCAO_HISTERESE))
       FormaNumero(&SensoresAtuadores[displayNumero].temp);
     else if((funcao==FUNCAO_CODIGO))
            {            
         if (flag_zerar)
             {
               flag_zerar = false;
               SensoresAtuadores[displayNumero].temp = 0;
             }
             FormaNumero(&SensoresAtuadores[displayNumero].temp);
             }
            
            
}

//===================================================================================
//Esc do sistema
void Pressionou_Asterisco() {    
     flag_zerar = true;
     tempoDecorrido = 0;
     autorestore = -1;
     funcao = FUNCAO_NONE;
     //PadronizaSensoresAtuadores("", NORMAL, false);
     //PadronizaValordoTempFloat(0);
     for (int8_t i = 0; i < MAXDEVICE; i++)
     {
         SensoresAtuadores[i].status = NORMAL;
         SensoresAtuadores[i].mensagem = "";
         SensoresAtuadores[i].temp = SensoresAtuadores[i].histerese;
     }
     if (++displayNumero >= MAXDEVICE) displayNumero = 0;
     flag_zerar = false;
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//Enter do Sistema
void Pressionou_Tecla_Sharp() 
     {
     if (funcao == FUNCAO_SETPOINT)
        {
        SensoresAtuadores[displayNumero].setpoint = SensoresAtuadores[displayNumero].temp;
        SensoresAtuadores[displayNumero].status = NORMAL;
        hardDisk.EEPROMWriteFloat((displayNumero*12), SensoresAtuadores[displayNumero].setpoint);
        funcao = FUNCAO_NONE;
        }     
    else if (funcao == FUNCAO_HISTERESE)
        {
        SensoresAtuadores[displayNumero].histerese = SensoresAtuadores[displayNumero].temp;
        SensoresAtuadores[displayNumero].status = NORMAL;
        hardDisk.EEPROMWriteFloat((12*displayNumero+4), SensoresAtuadores[displayNumero].histerese);
        funcao = FUNCAO_NONE;
        }
    else if (funcao == FUNCAO_CODIGO)
        { 
        static uint8_t enter = 0;
        static float codigo;
        static float parametro;
        if (enter == 0)
            {
            tempoDecorrido = 2000;
            Serial.print("Digitou o codigo ");
            Serial.println(SensoresAtuadores[displayNumero].temp, 3);
            codigo = round(SensoresAtuadores[displayNumero].temp * 1000);
            SensoresAtuadores[displayNumero].mensagem = "----";
            SensoresAtuadores[displayNumero].status = DINAMICO;
            SensoresAtuadores[displayNumero].temp = 0;
            enter++;      
            if((codigo==DEFAULT_FACT)|| //Restaura padrão de Fabrica
               (codigo==OFFSET_VIEW))   //Seta offset dos sensores
               { 
               executaTarefa(codigo, 0);
               enter = 0;
               }
            }
        else
            { 
            tempoDecorrido = 2000;
            SensoresAtuadores[displayNumero].status = NORMAL;
            Serial.print("Com o parametro ");
            Serial.println(SensoresAtuadores[displayNumero].temp, 3);
            parametro = round(SensoresAtuadores[displayNumero].temp * 1000);
            enter = 0;
            executaTarefa(codigo, parametro);
            }
        }   
    }



//=======================================================================================================================================
void SaidaAutomatica(uint8_t acao)
     {
     if(acao==SETA)
       { 
         autorestore = TEMPO_MAX_EDICAO;
       }
     else if (acao==MONITORA)
       {
         if (autorestore > 0)
             autorestore--;
         else if (autorestore == 0)
         {
             autorestore = -1;
             for (uint8_t i = 0; i < MAXDEVICE; i++)
                 {
                 SensoresAtuadores[i].status = NORMAL;
                 funcao = FUNCAO_NONE;
                 displayNumero = MAXDEVICE+1;
                 flag_zerar = true;
                 }
         }
       }
     }




//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
void SetarInformacaoeIndice(uint8_t index, String Texto){
SensoresAtuadores[displayNumero].mensagem = Texto;
//SensoresAtuadores[displayNumero].index_message = index;
SensoresAtuadores[displayNumero].temp = 0;
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
void FormaNumero(float* number) {
    float temp;
    if (flag_zerar)
    {
        flag_zerar = false;
        *number = 0;
    }

    (*number) *= 10.0;
    temp = (tecla_pressionada - 48) * 0.001;

    (*number) += temp;
}

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
void executaTarefa(uint32_t codigo, uint32_t parametro) {
    float  temp;
    float _codigo;
    float _parametro;
    _codigo = codigo/1000.0;
    _parametro = parametro/1000.0;
     if(codigo==DEFAULT_FACT)
       { 
         hardDisk.EEPROMWriteFloat(0, 127.0); //SetPoint V
         hardDisk.EEPROMWriteFloat(4,  15.0); //Histerese V
         hardDisk.EEPROMWriteFloat(8,   0.0); //OFF Set V

         hardDisk.EEPROMWriteFloat(12, -35.0); //SetPoint Condensador
         hardDisk.EEPROMWriteFloat(16,  20.0);  //Histerese Condensador
         hardDisk.EEPROMWriteFloat(20, 0.0);//Off set condensador

         hardDisk.EEPROMWriteFloat(24, 600.0);  //SetPoint Vacuometro
         hardDisk.EEPROMWriteFloat(28, 200.0);  //Histerese Vacuometro
         hardDisk.EEPROMWriteFloat(32, 0.0);  //Off Set Vacuometro
    
         for (uint8_t i = 0; i < MAXDEVICE; i++)
             {            
             SensoresAtuadores[i].setpoint  = hardDisk.EEPROMReadFloat(12 * i + 0);
             SensoresAtuadores[i].histerese = hardDisk.EEPROMReadFloat(12 * i + 4);
             SensoresAtuadores[i].offset    = hardDisk.EEPROMReadFloat(12 * i + 8);
             SensoresAtuadores[i].status    = NORMAL;
             }
         funcao = FUNCAO_NONE;
         Serial.println("Valores padrao de fabrica carregados!");
       }
     else if (codigo == OFFSET_SETAR)
             {
             Serial.printf("Voce setou o offset de condensador em %3.3f *C\n", _parametro);
             SensoresAtuadores[displayNumero].offset = _parametro;
             hardDisk.EEPROMWriteFloat(12 * displayNumero + 8, _parametro);
             }
     else if (codigo == OFFSET_VIEW)
             {
             funcao = FUNCAO_NONE;
             SaidaAutomatica(SETA);
             SensoresAtuadores[displayNumero].status = DINAMICO;
             SensoresAtuadores[displayNumero].mensagem = "OFF.S";
             SensoresAtuadores[displayNumero].temp = hardDisk.EEPROMReadFloat(12*displayNumero+8);
             Serial.printf("Voce esta visualizando o Offset");
             }
     else
        { 
         Serial.println("Código inválido!");
        }

}

This is my main code. I want the other code (Terminal.cpp) to respond, but I’m not able to do that. I have already declared the response object as ‘external’ but an error occurs.

#include "Terminal.h"
#include "global.h"
#include "Eeprom_Indka.h"



extern uint8_t  hora;
extern uint8_t  minuto;
extern uint8_t  segundo;
extern uint16_t milisegundo;  

//--TRABALHAR AQUI PARA HABILITAR O TERMINAL--------
//#include "Blynk.h"
//#include "WiFi.h"
//#include "WiFiClient.h"
//#include "BlynkSimpleEsp32.h"
//#include "WidgetTerminal.h"
//WidgetTerminal terminalb(V5);
//external BlynkWifi Blynk;
//---------------------------------------------------

extern Controladores SensoresAtuadores[MAXDEVICE];

extern Eeprom_Indka hardDisk;

boolean flag_hora   = false;

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

/*
Terminal::Terminal(void)
  {
  //Serial.println("Funcionou");
    digitalWrite(LED, HIGH);
    delay(1000);
  };
*/


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void Terminal::empresa(void)
     {
     //terminalb.println("Dentro da Funcao...");
     Serial.println("Fabricado por:");
     Serial.println("-----------------------------------------------");
     Serial.println("Axiohm Automação e Conectividade");
     Serial.println("   A Axiohm atua no setor industrial oferecendo");
     Serial.println("   automação, instrumentação e conectividade.");
     Serial.println("   site : www.axiohm.com.br");
     Serial.println("   fone : (16) 98125-8655 (também whatsapp).");
     Serial.println("-----------------------------------------------");  
     Serial.print(PROMPT);
     }

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void Terminal::mostraTempo(void)
     {
     static uint16_t counter;
     counter++;
     if (counter % 4 == 0)
         {         
         Serial.print(" Hora do sistema- ");
         if (hora < 10) Serial.print("0");
         Serial.print(hora);
         Serial.print(":");
         if (minuto < 10) Serial.print("0");
         Serial.print(minuto);
         Serial.print(":");
         if (segundo < 10) Serial.print("0");
         Serial.print(segundo);
         Serial.print("'");
         if (milisegundo < 100)Serial.print("0");
         if (milisegundo < 10)Serial.print("0");
         Serial.print(milisegundo);
         Serial.print(" ");
         Serial.write(13);
         }
     }



//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
extern String bufferblk;
extern boolean flag_rxb;
String buffer = "";
char c = 0;
char *texto;
uint16_t valor;
//static bool flag_showkey=false;
//String memoria[10];
//int8_t indice = -1;

//Seriall seriall = Seriall();

void Terminal::interpretador(void)
{
   static uint8_t index = 0;

   //Relógio em tempo real
   if (c == 0 && flag_hora) mostraTempo();

   

   if ((Serial.available())||(flag_rxb))
   {
       
       c = Serial.read();
       flag_hora = false;

       if (c >= 0x20)
       {
           Serial.write(c);
           buffer += c;
           index++;
       }
       else
       {
           if (c == 8) //backspace
           {
               if (index > 0)
               {
                   // 5 - retorna o nome do terminal
                   index--;
                   Serial.write(127);
                   buffer.remove(buffer.length() - 1, 1);
               }
               else
               {
                   Serial.write(7);//bell
               }
           }
           else if (c == '\r') //enter
           {
               Serial.println();
               buffer += '\0';
               index = 0;               
           }
           else //--
           {
               Serial.println("? Nao foi possivel interpretar");
           }
       } //Caracteres especiais 

   }
           //+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
           if (flag_rxb)
           {
               flag_rxb = false;
               c = 13;
               buffer = bufferblk;
               //terminalb.println("Essa saiu!");
           }
           //+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +          

           if (c == 13) //ENTER
           {
               
               buffer.toUpperCase();

               if (buffer == "CLS")
               {
                   Serial.write(12);
               }
               else if (buffer.startsWith("TIME"))
               {
                   if (buffer=="TIME")
                      { 
                      flag_hora = true;
                      //Serial.println();
                      }
                   else if (buffer.length() == 14) //Hora completa a ser setada
                      {
                       String  hh;
                       String  mm;
                       String  ss;
                      
                       hh = buffer.substring(5, 7);
                       mm = buffer.substring(8, 10);
                       ss = buffer.substring(11);                     

                       hora = hh.toInt();
                       minuto = mm.toInt();
                       segundo = ss.toInt();
                       milisegundo = 0;
                       Serial.println("Relógio setado com sucesso!");
                     }
                   else
                     { 
                       Serial.println("Erro de sintaxe. Utilize 'time hh:mm:ss'.");
                     }

               }
               else if (buffer == "CONDENSADOR")
               {
                   Serial.print(SensoresAtuadores[CONDENSADOR].valor(COMPOSTO)); Serial.println("°C.");
               }
               else if (buffer == "CONDENSADOR /INFO")
               {
                   
                   Serial.println("-------------------------------------");
                   Serial.print("Atual    = "); Serial.print(SensoresAtuadores[CONDENSADOR].valor(SIMPLES)); Serial.println("°C.");
                   Serial.print("Composto = "); Serial.print(SensoresAtuadores[CONDENSADOR].valor(COMPOSTO)); Serial.println("°C.");
                   Serial.println("- - - - - - - - - - - - - - - - - - - ");
                   Serial.print("SetPoint = "); Serial.print(SensoresAtuadores[CONDENSADOR].setpoint); Serial.println("°C.");
                   Serial.print("Histerese= "); Serial.print(SensoresAtuadores[CONDENSADOR].histerese); Serial.println("°C.");
                   Serial.print("OffSet   = "); Serial.print(SensoresAtuadores[CONDENSADOR].offset); Serial.println("°C.");
                   Serial.print("Superior = "); Serial.print(SensoresAtuadores[CONDENSADOR].setpoint + SensoresAtuadores[CONDENSADOR].histerese); Serial.println("°C.");
                   Serial.print("Inferior = "); Serial.print(SensoresAtuadores[CONDENSADOR].setpoint - SensoresAtuadores[CONDENSADOR].histerese); Serial.println("°C.");
                   Serial.println("-------------------------------------");                   
               }
               else if (buffer.startsWith("CONDENSADOR /H"))
               {                      
                   buffer.remove(0, 15);
                   SensoresAtuadores[CONDENSADOR].histerese = buffer.toFloat();
                   Serial.print("Ajustando Histerese para "); Serial.print(SensoresAtuadores[CONDENSADOR].histerese); Serial.println("°C.");
                   hardDisk.EEPROMWriteFloat(ADD_CONDENSADOR_HIS, buffer.toFloat());

               }
               else if (buffer.startsWith("CONDENSADOR /S"))
               {
                   buffer.remove(0, 15);
                   SensoresAtuadores[CONDENSADOR].setpoint = buffer.toFloat();
                   Serial.print("Ajustando SetPoint para "); Serial.print(SensoresAtuadores[CONDENSADOR].setpoint); Serial.println("°C.");
                   hardDisk.EEPROMWriteFloat(ADD_CONDENSADOR_SET, buffer.toFloat());
               }
               else if (buffer.startsWith("CONDENSADOR /O"))
               {
                   buffer.remove(0, 15);
                   SensoresAtuadores[CONDENSADOR].offset = buffer.toFloat();
                   Serial.print("Ajustando Offset para "); Serial.print(SensoresAtuadores[CONDENSADOR].offset); Serial.println("°C.");
                   hardDisk.EEPROMWriteFloat(ADD_CONDENSADOR_OFF, buffer.toFloat());
               }
               else if (buffer.startsWith("HELP"))
               {
                   Serial.println("--------------------------------------------");
                   Serial.println("Digite os seguintes comandos:");
                   Serial.println(" cls         - Limpa a tela.");
                   Serial.println(" help        - Exibe esta ajuda.");
                   Serial.println(" time        - Exibe ou altera o relógio.");
                   Serial.println(" empresa     - Exibe o fabricante deste hardware.");
                   Serial.println(" model       - Exibe o modelo do hardware.");
                   Serial.println(" vaccum      - Exibe ou altera parametros.");
                   Serial.println(" condensador - Exibe ou altera parametros.");
                   Serial.println("--------------------------------------------");
               }
               else if (buffer == "EMPRESA")
               {
                   Serial.println("Fabricado por:");
                   Serial.println("--------------------------------------------");
                   Serial.println("JJ Científica Equipamentos Indústriais.");
                   Serial.println("   Liofilizamos o Impossível.");
                   Serial.println("   site : www.jjcientificaa.com.br");
                   Serial.println("   fone : (16) 3306-9193 (também whatsapp).");
                   Serial.println("--------------------------------------------");
               }
               else if (buffer == "MODEL")
               {
                   Serial.println("Hardware modelo ITCV1000 revisao 1.0.0.");
               }               
               else
               {
                   if (buffer.length() > 1)
                       {
                       Serial.println("Comando inválido.");
                       //Serial.print(buffer);
                       //Serial.println("'.");
                       Serial.println("Digite 'help' para instruções.");
                       }
                }
           c = 0;
           if (buffer != "TIME") Serial.print(PROMPT);           
           buffer = "";
           } 

       }

Good morning Pete. The system limited my posts. We can continue?

I don’t understand your code, so there’s nothing I can add that will help.

Pete.

Pete, basically I don’t know how to print from the blink terminal in another cpp file. I have already tried to declare an external variable but it is an error.

Can someone help me?

Hello guys.
I’m trying to implement a terminal project with blynk where my terminal file is external but I can’t. I have already tried to declare my printing variable as external but it is an error. I can send commands, what I can’t see is the commands sent by the Arduino. Can someone help me. I will send an example project where I include my terminal file. Look below.

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************

  You can send/receive any data using WidgetTerminal object.

  App project setup:
    Terminal widget attached to Virtual Pin V1
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include "Terminal.h"  <-------------------------See this Line

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

// Attach virtual serial terminal to Virtual Pin V1
WidgetTerminal terminal(V1);

// You can send commands from Terminal to your hardware. Just use
// the same Virtual Pin as your Terminal Widget
BLYNK_WRITE(V1)
{

  // if you type "Marco" into Terminal Widget - it will respond: "Polo:"
  if (String("Marco") == param.asStr()) {
    terminal.println("You said: 'Marco'") ;
    terminal.println("I said: 'Polo'") ;
  } else {

    // Send it back
    terminal.print("You said:");
    terminal.write(param.getBuffer(), param.getLength());
    terminal.println();
  }

  // Ensure everything is sent
  terminal.flush();
}

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth);

  // Clear the terminal content
  terminal.clear();

  // This will print Blynk Software version to the Terminal Widget when
  // your hardware gets connected to Blynk Server
  terminal.println(F("Blynk v" BLYNK_VERSION ": Device started"));
  terminal.println(F("-------------"));
  terminal.println(F("Type 'Marco' and get a reply, or type"));
  terminal.println(F("anything else and get it printed back."));
  terminal.flush();
}

void loop()
{
  Blynk.run();
}