There is void loop because the program need a loop to compile but it should remain empty.Īnd that's it. Then move the cursor to the second line and the left most position lcd.setCursor(0,1) Then I tell it to go to the first line at left most position lcd.setCursor(0,0) Lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE) lcd.setBacklight(HIGH) Then I turn on the back light (always good to have a lit LCD), notice it is the same variable from above. In the void set up, we start by telling the IDE that we are dealing with a 16X2 LCD Initialise the LCD LiquidCrystal_I2C lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin) #define I2C_ADDR 0x27 //Define I2C Address where the PCF8574A isĪnother line is needed to initialize the LCD, this is done through an array which includes the variables that we defined earlier. in this section just copy it as is because it tells the IDE where to find the PCF8574A and how to interact with the LCD to turn on the backlight, the read pin, the write pin and data pins etc. I attached a copy of the sketch I used in this instructable,įirst you need to load the libraries, we will load wire.h, LCD.h and LiquidCrystal_I2C.h On my computer the default location was C:\programfiles\Arduino\library. Once you have the library, extract the contents in the Arduino library folder on your computer. I will add a zip file with the library for Windows or you can go the site. Step one is to download the Liquid Crystal library if you haven't done so already.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |