Tetsuya Hoshino / AQM0802A

Dependents:   CatPot_Main_ver1 CatPot_Main_F NuFM401 CatPot_Main_ver2 ... more

Embed: (wiki syntax)

« Back to documentation index

AQM0802A Class Reference

AQM0802A Class Reference

Akizuki I2C 8x2 Character LCD AQM0802A driver class. More...

#include <AQM0802A.h>

Public Member Functions

 AQM0802A (PinName sda, PinName scl)
 Constructor.
 AQM0802A (I2C &i2c)
 Constructor.
void cls ()
 Clear screen.
void home ()
 Set cursor to home position.
void setContrast (int contrast)
 Change the contrast of the screen.
void setCursor (int x, int y)
 Change the cursor position to {x, y}.

Detailed Description

Akizuki I2C 8x2 Character LCD AQM0802A driver class.


秋月 I2C 8x2 小型キャラクタLCD AQM0802A用 ドライバクラスです。
 http://akizukidenshi.com/catalog/g/gK-06795/
Copyright(C)2014 T.Hoshino

CAUTION: My English is very poor, it might be wrong. (I rely on Google Translate almost.)

  • Stream 継承なので、printf() 等も利用可能です。
    This class inherits Stream, Its public methods (printf() etc.) are also available.
  • 文字コード '\r'(0x0D) の出力でカーソル位置は行頭に移動します。
    When you output the character code '\r'(0x0D), the cursor position is move to the beginning of line.
  • 文字コード '\n'(0x0A) の出力でカーソル位置は次の行の先頭に移動します。
    When you output the character code '\n'(0x0A), the cursor position is move to the beginning of next line.
//----------------------------------------
// Sample code for ST Nucleo F401RE
//----------------------------------------
#include <mbed.h>
#include <AQM0802A.h>

AQM0802A lcd(D14, D15); // <-- this !
Ticker   ticker;

void tick() {
    static int count = 0;
    lcd.cls();
    lcd.printf("Hello\n %d", count++);
}

int main() {
    ticker.attach(&tick, 0.1);
    while(1) {
    }
}

ご自由にお使いいただけますが、無保証です。使用は自己責任でどうぞ。
The use of this is free, but no warranty. please use at your own risk.

Definition at line 54 of file AQM0802A.h.


Constructor & Destructor Documentation

AQM0802A ( PinName  sda,
PinName  scl 
)

Constructor.

Parameters:
sdaserial data pin
sclserial clock pin

Definition at line 3 of file AQM0802A.cpp.

AQM0802A ( I2C &  i2c )

Constructor.

Parameters:
i2creference to i2c bus object.

Definition at line 9 of file AQM0802A.cpp.


Member Function Documentation

void cls (  )

Clear screen.

画面をクリアします。
After clear screen, the cursor position will be changed to {x:0, y:0}.
画面クリア後、カーソル位置は {x:0, y:0} に変更されます。

See also:
home()

Definition at line 46 of file AQM0802A.cpp.

void home (  )

Set cursor to home position.

カーソル位置をホームポジションに移動します。
The cursor position will be changed to {x:0, y:0}. At that time, it does not clear the screen display.
カーソル位置を {x:0, y:0} に変更します。その際、画面表示はクリアしません。

See also:
cls()

Definition at line 52 of file AQM0802A.cpp.

void setContrast ( int  contrast )

Change the contrast of the screen.

画面のコントラストを変更します。
Practical range in about 20-40, the initial value is 32. 実用的な範囲は20~40ぐらいで、初期値は32です。
Only the lower 6 bits are valid. 下位6ビットのみ有効です。

Parameters:
contrast0(bright) to 63(dark). The initial value is 32.

Definition at line 58 of file AQM0802A.cpp.

void setCursor ( int  x,
int  y 
)

Change the cursor position to {x, y}.

指定位置 {x, y} にカーソルを移動します。
The position of left top is {0, 0}. Right bottom is {7, 1}. 左上は {0, 0}、右下は{7, 1} です。

Parameters:
x0 to 7 : Column position of the cursor.
y0 to 1 : Row position of the cursor.

Definition at line 65 of file AQM0802A.cpp.