You can output chars to AQM1602 with printf(). ex. lcd.printf("iter: %5.5d.\r\n", iter);
Dependents: aqm1602 FCAS-M101V1
AQM1602 Class Reference
LCD AQM1602 library, refer to http://akizukidenshi.com/catalog/g/gP-08779/. More...
#include <AQM1602.h>
Public Member Functions | |
void | init () |
Initialize. | |
void | clear () |
Clear Display. | |
void | cr () |
CR, LF. | |
void | locate (int col, int row) |
Set Position of char. | |
void | setContrast (char val, bool ctrlIS=true) |
Set Contrast. | |
void | setDispFlag (bool disp=true, bool cursor=true, bool blink=true) |
Set Display flag. |
Detailed Description
LCD AQM1602 library, refer to http://akizukidenshi.com/catalog/g/gP-08779/.
16 chars x 2 lines. I select 20k ohm as pullup resistor.
#include "mbed.h" #include "AQM1602.h" I2C i2c(p28, p27); AQM1602 lcd(i2c); // if 5.0v supply, (i2c, false); DigitalOut led[]= {LED1, LED2, LED3, LED4}; int main() { lcd.init(); int iter= 0; while(true) { led[0] = !led[0]; lcd.printf("iter: %5.5d.\r\n", iter); wait(1.0f); if(iter%10 == 0) // 10s lcd.clear(); iter++; } }
Definition at line 35 of file AQM1602.h.
Member Function Documentation
void clear | ( | ) |
Clear Display.
Definition at line 153 of file AQM1602.cpp.
void cr | ( | ) |
CR, LF.
Definition at line 162 of file AQM1602.cpp.
void init | ( | ) |
Initialize.
Definition at line 69 of file AQM1602.cpp.
void locate | ( | int | col, |
int | row | ||
) |
Set Position of char.
- Parameters:
-
col,: column, row: rows.
Definition at line 61 of file AQM1602.cpp.
void setContrast | ( | char | val, |
bool | ctrlIS = true |
||
) |
Set Contrast.
- Parameters:
-
val; 64steps, 0x00 ~ 0x3f. Contrast increas as the value. default: 0x23.
Definition at line 108 of file AQM1602.cpp.
void setDispFlag | ( | bool | disp = true , |
bool | cursor = true , |
||
bool | blink = true |
||
) |
Set Display flag.
Enable Display, Cursor turned on, Cursor Blink.
Definition at line 185 of file AQM1602.cpp.
Generated on Fri Jul 15 2022 14:56:43 by 1.7.2