Converting to an I2C display and other developments

Ian KD8CEC is busy opening up the possibilities for including different code sections in his new version 1.07 under development.  This will include the ability to readily shift to an I2C display in order to reclaim digital I/O ports needed for other features.

In the mean time, Bill K9HZ provides a succinct code listing required to get an I2C display to work

The following TWO things need to be done in Ian’s version 1.07 code (BETA):

1. Change Display models in “ubitx_20” :

From this:

#define UBITX_DISPLAY_LCD1602P      //LCD mounted on unmodified uBITX

//#define UBITX_DISPLAY_LCD1602I    //I2C type 16 x 02 LCD

//#define UBITX_DISPLAY_LCD2404P    //24 x 04 LCD

//#define UBITX_DISPLAY_LCD2404I    //I2C type 24 x 04 LCD

To this:

//#define UBITX_DISPLAY_LCD1602P    //LCD mounted on unmodified uBITX

#define UBITX_DISPLAY_LCD1602I        //I2C type 16 x 02 LCD

//#define UBITX_DISPLAY_LCD2404P    //24 x 04 LCD

//#define UBITX_DISPLAY_LCD2404I    //I2C type 24 x 04 LCD

2. Update Ian’s code to use the I2C libraries in “ubitx_lcd_1602i” :

From this:

#include <LiquidCrystal.h>

LiquidCrystal lcd(8,9,10,11,12,13);

To this:

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  //

JUST MAKE SURE THE ADDRESS IS CORRECT…

in the instance above the add-on board on the back of the display is set to address “3F”.  You can use the scanner to find the correct address.

Reference