#define BLYNK_TEMPLATE_ID "TMPLxxxxxx" #define BLYNK_DEVICE_NAME "Device" #define BLYNK_AUTH_TOKEN "YoD0rND7VQo7svPaEN2MnDlnPXTakXPg" // Comment this out to disable prints and save space #define BLYNK_PRINT SwSerial #include <SoftwareSerial.h> SoftwareSerial SwSerial(10, 11); // RX, TX #include <BlynkSimpleStream.h> char auth[] = BLYNK_AUTH_TOKEN; #include <LiquidCrystal.h> float x,y,z; LiquidCrystal lcd(2, 3, 4, 5, 6, 7); // Use Virtual pin 5 for uptime display #define PIN_UPTIME V5 // This function tells Arduino what to do if there is a Widget // which is requesting data for Virtual Pin (5) BLYNK_READ(PIN_UPTIME) { // This command writes Arduino's uptime in seconds to Virtual Pin (5) Blynk.virtualWrite(PIN_UPTIME, millis() / 1000); } void setup() { // Debug console SwSerial.begin(115200); pinMode(13, OUTPUT); lcd.begin(20, 4); lcd.setCursor(4,1); lcd.print("Hello...."); delay(2000); lcd.clear(); delay(1000); lcd.setCursor(1,0); lcd.print("Ipasa mo kami"); delay(300); lcd.setCursor(5,1); lcd.print("By"); delay(300); lcd.setCursor(6,2); lcd.print("Group 3"); delay(300); lcd.setCursor(3,3); lcd.print("Awa na"); delay(3000); lcd.clear(); delay(1000); lcd.print("->YR"); lcd.setCursor(14,0); lcd.print("21<-"); // Blynk will work through Serial // Do not read or write this serial manually in your sketch Serial.begin(9600); Blynk.begin(Serial, auth); } void loop() { Blynk.run(); x = ((analogRead(A0)*2.0)/1024.0)-1; y = ((analogRead(A1)*2.0)/1024.0)-1; z = ((analogRead(A2)*2.0)/1024.0)-1; lcd.setCursor(6,1); lcd.print("gX = "); lcd.print(x); lcd.setCursor(6,2); lcd.print("gY = "); lcd.print(y); lcd.setCursor(6,3); lcd.print("Z = "); lcd.print(z); }
Read the forum guidelines to see how to properly post code and some information on how to get the most from this forum.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination
SOP in cases where there are a few things going on in a program, is to strip it down to the bare minimum. It would be a worthwhile exercise to write a very short program simply to a) test that the LCD shows anything at all (a "Hello, World!" type sketch) and then b) shows the results of the analogRead()'s. That way you'll be sure the issue's got nothing to do with the software serial stuff that's going on- no Blynk in the way.
All I know about Proteus is that it's some kind of sim; I'd be very inclined to test the lcd for real on a real Arduino- perhaps the issue is Proteus failing to simulate properly?
Do you mean not showing up on the LCD or with Blynk?
I tested the code, without the Blynk parts, on an real LCD and my Uno and it seems to display OK.
Are you sure that Blynk will run on Proteus?
There is a Proteus forum.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.