Hi guys, Im new to blynk and microcontoroller arduino, today i just succeeded in linking both my Blynk app and arduino without using any wifi modules(esp8266, EspressoLiteV2). My current progress for my project is i already managde to use the menu interface widget to give output to my LCD 16*2 which is connected to my arduino. Here is the code:
BLYNK_WRITE(V1) {
switch(param.asInt()){
LCD.begin(16,2);
case 1:
{
LCD.print("Please Wait..");
delay(2000);
LCD.clear();
break;
}
case 2:
{
LCD.print("No one home..");
delay(2000);
LCD.clear();
break;
}
case 3:
{
LCD.print("Leave us alone");
delay(2000);
LCD.clear();
break;
}
}
}
However, this method restricting me in giving the particular messages only to my LCD. Im thinking in sending any message which is written in terminal to the arduino LCD. Is it possible? Im still figure it out. Thank you!
Yes it is. See the terminal example. You can send stuff as easily to/from the terminal as the LCD.
hi thank you for reply. i got the code already from one of the discussion in this community. however, i stil cannot give it a try because my terminal widget in blynk cannot give any output, eve when im using sketch example. i dont know why
Can you show us the code you have and how your terminal widget is configured?
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX
LiquidCrystal LCD(7,8,9,10,11,12);
#define BLYNK_PRINT DebugSerial
#include <BlynkSimpleStream.h>
char auth[] = “d0161662762f4e50957d8c4bfea085b1”;
boolean mssg;
int loceng;
WidgetTerminal term(V2);
void setup()
{
pinMode(6,INPUT);
DebugSerial.begin(9600);
Serial.begin(9600);
Blynk.begin(auth, Serial);
}
void loop()
{
Blynk.run();
if((loceng=digitalRead(6))==1)
{
Blynk.notify(“JIMBIT is coming”);
}
}
BLYNK_WRITE(V1) {
switch(param.asInt()){
LCD.begin(16,2);
case 1:
{
LCD.print("Please Wait..");
delay(2000);
LCD.clear();
break;
}
case 2:
{
LCD.print("No one home..");
delay(2000);
LCD.clear();
break;
}
case 3:
{
LCD.print("Leave us alone..");
delay(2000);
LCD.clear();
break;
}
}
}
BLYNK_WRITE(V2)
{
if(mssg==true&&(String(“Message”) != param.asStr()) )//Prints To Lcd
{
LCD.begin(16,2);
LCD.clear();
LCD.setCursor(0,0);
LCD.print(param.asString());
mssg=false;
}
if (String(“Message”) == param.asStr())//Initiate Lcd transfer
{
LCD.clear();
term.println(“Enter Message”) ;
mssg=true;
}
}
I think it’s term.print and not term.println. You have to add the \n manually. Can you try with term.print?