Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

/*

Tip1: don't write integers to the lcd because it


will write out the ascii code for it
instead use String class and write to the lcd
using the .c_str() function
Tip2: the SDA pin from the I2C goes into pin A4
on the Arduino and the SCL pin from the I2C goes into pin A5
*/
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define
#define
#define
#define
#define
#define
#define
#define
#define

I2C_ADDR 0x27 // <<- Add your address here.


Rs_pin 0
Rw_pin 1
En_pin 2
BACKLIGHT_PIN 3
D4_pin 4
D5_pin 5
D6_pin 6
D7_pin 7

LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin)
;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
lcd.begin(16,2);
lcd.home();
lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);
lcd.setBacklight(HIGH);
}
void loop(){
lcd.clear();
lcd.write("Angle");
lcd.setCursor(0,1);
lcd.write("Temp");
delay(500);
}

You might also like