Difference between revisions of "Unit AF16x2LCD"
Line 20: | Line 20: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''AF16x2LCD specific | + | <div style="font-size: 14px; padding-left: 12px;">'''AF16x2LCD specific''' <code> AF16X2LCD_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 44: | Line 44: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''AF16x2LCD GPIO | + | <div style="font-size: 14px; padding-left: 12px;">'''AF16x2LCD GPIO pin''' <code> GPIO_PIN_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 143: | Line 143: | ||
|- | |- | ||
| <code>AF16X2LCD_MODEL:LongWord = AF16X2LCD_MODEL_RGB;</code> | | <code>AF16X2LCD_MODEL:LongWord = AF16X2LCD_MODEL_RGB;</code> | ||
− | | style="width: | + | | style="width: 40%;"| |
|- | |- | ||
|} | |} | ||
Line 149: | Line 149: | ||
|- | |- | ||
| <code>AF16X2LCD_I2C_ADDRESS:Word = $20;</code> | | <code>AF16X2LCD_I2C_ADDRESS:Word = $20;</code> | ||
− | | style="width: | + | | style="width: 40%;"| |
|- | |- | ||
|} | |} | ||
Line 155: | Line 155: | ||
|- | |- | ||
| <code>AF16X2LCD_I2C_DEVICE:String = 'I2C0';</code> | | <code>AF16X2LCD_I2C_DEVICE:String = 'I2C0';</code> | ||
− | | style="width: | + | | style="width: 40%;"| |
|- | |- | ||
|} | |} |
Revision as of 01:30, 24 March 2017
Return to Unit Reference
Contents
[hide]Description
Adafruit 16x2 Character LCD + Keypad Driver unit
The Adafruit 16x2 LCD + Keypad is a kit that includes both a 16x2 LCD display using the Hitachi HD44780 LCD controller as well as a custom PCB with an MCP23017 I/O expander to connect it to a Raspberry Pi (any model) using I2C. It is available in Monochrome or RGB Positive and Negative versions.
This unit ties together the various components needed to make one of these boards work with Ultibo by finding the correct I2C device, creating the MCP230XX GPIO device, creating the HD44780 Console device and registering all of it with the correct parameters for the Adafruit kit.
The unit also includes functions to read the 5 buttons on the board and control the LCD backlight.
You will find many LCD display boards based on the Hitachi HD44780 controller and this unit gives an example of how to assembler the available units to create your own driver for a different board.
Constants
AF16X2LCD_*
GPIO_PIN_*
Type definitions
AF16x2LCD specific types
Public variables
AF16x2LCD specific variables
AF16X2LCD_MODEL:LongWord = AF16X2LCD_MODEL_RGB;
|
AF16X2LCD_I2C_ADDRESS:Word = $20;
|
AF16X2LCD_I2C_DEVICE:String = 'I2C0';
|
Function declarations
Initialization functions
function AF16x2LCDStart(Model:LongWord;Invert:Boolean; const Device:String; Address:Word):THandle;
function AF16x2LCDStop(Handle:THandle):Boolean;
AF16x2LCD functions
function AF16x2LCDGetButton(Handle:THandle; Button:LongWord):LongWord;
function AF16x2LCDBacklightOn(Handle:THandle):Boolean;
function AF16x2LCDBacklightOff(Handle:THandle):Boolean;
function AF16x2LCDBacklightColor(Handle:THandle; Red,Green,Blue:Byte):Boolean;
Return to Unit Reference