Hi guys! I have a little problem with my shiny new I2C-LCD 20x4 screen. I bought this one
LCD Display Module
I downloaded the LiquidCrystal_I2C library (from the official Arduino site) by Frank de Brabander version 1.1.2 to communicate with the screen.
I then copy past the code from a tutorial on youtube here is the link
Pressure Sensor Arduino
I have connected everything according to the video and Arduino - Wire (A4 (SDA), A5 (SCL))
I hope that you can see the pictures...
Here is the code (I only changed the communication address from the one I got after running the scanner)
<
#include "Wire.h" //allows communication over i2c devices
#include "LiquidCrystal_I2C.h" //allows interfacing with LCD screens
const int pressureInput = A0; //select the analog input pin for the pressure transducer
const int pressureZero = 102.4; //analog reading of pressure transducer at 0psi
const int pressureMax = 921.6; //analog reading of pressure transducer at 100psi
const int pressuretransducermaxPSI = 200; //psi value of transducer being used
const int baudRate = 9600; //constant integer to set the baud rate for serial monitor
const int sensorreadDelay = 250; //constant integer to set the sensor read delay in milliseconds
float pressureValue = 0; //variable to store the value coming from the pressure transducer
LiquidCrystal_I2C lcd(0x27, 20, 4); //sets the LCD I2C communication address; format(address, columns, rows)
void setup() //setup routine, runs once when system turned on or reset
{
Serial.begin(baudRate); //initializes serial communication at set baud rate bits per second
lcd.begin(); //initializes the LCD screen
}
void loop() //loop routine runs over and over again forever
{
pressureValue = analogRead(pressureInput); //reads value from input pin and assigns to variable
pressureValue = ((pressureValue-pressureZero)*pressuretransducermaxPSI)/(pressureMax-pressureZero); //conversion equation to convert analog reading to psi
Serial.print(pressureValue, 1); //prints value from previous line to serial
Serial.println("psi"); //prints label to serial
lcd.setCursor(0,0); //sets cursor to column 0, row 0
lcd.print("Pressure:"); //prints label
lcd.print(pressureValue, 1); //prints pressure value to lcd screen, 1 digit on float
lcd.print("psi"); //prints label after value
lcd.print(" "); //to clear the display after large values or negatives
delay(sensorreadDelay); //delay in milliseconds between read values
}
/>
Here is the error message that I got
D:\Docs de Frederic\Documents\Arduino\pressure_sensor\pressure_sensor.ino: In function 'void setup()':
pressure_sensor:20:13: error: no matching function for call to 'LiquidCrystal_I2C::begin()'
lcd.begin(); //initializes the LCD screen
^
In file included from D:\Docs de Frederic\Documents\Arduino\pressure_sensor\pressure_sensor.ino:4:0:
D:\Docs de Frederic\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:8: note: candidate: void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)
void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS );
^~~~~
D:\Docs de Frederic\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:8: note: candidate expects 3 arguments, 0 provided
exit status 1
no matching function for call to 'LiquidCrystal_I2C::begin()'
Thanks in advance.