I am trying to run(built-in/ready made )lcd template that is available on tinkercad website. When i click on LCD there are two options in type box 1) (which is default) MCP 23008-based 2) PCF 8574-based
When i select option 1 and then press start simulation ,my code is running fine and lcd is displaying properly but when i select option 2 and then press start simulation,nothing is displayed but also no error is shown on serial monitor.
My modified code is as follow:
// C++ code
//
//#include <Adafruit_LiquidCrystal.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
int seconds = 0;
//#Adafruit_LiquidCrystal lcd_1(0);
LiquidCrystal_I2C lcd_1(0x27, 16, 2);
void setup()
{
lcd_1.begin(16, 2);
lcd_1.print("Hello World");
}
void loop()
{
lcd_1.setCursor(0, 1);
lcd_1.print(seconds);
lcd_1.setBacklight(1);
delay(500); // Wait for 500 millisecond(s)
lcd_1.setBacklight(0);
delay(500); // Wait for 500 millisecond(s)
seconds += 1;
}
while original code was
// C++ code
//
#include <Adafruit_LiquidCrystal.h>
int seconds = 0;
Adafruit_LiquidCrystal lcd_1(0);
void setup()
{
lcd_1.begin(16, 2);
lcd_1.print("hello world");
}
void loop()
{
lcd_1.setCursor(0, 1);
lcd_1.print(seconds);
lcd_1.setBacklight(1);
delay(500); // Wait for 500 millisecond(s)
lcd_1.setBacklight(0);
delay(500); // Wait for 500 millisecond(s)
seconds += 1;
}