LoginSignup
0
0

More than 1 year has passed since last update.

LPC812MAXで「HELLO」と液晶表示(AQM0802A)(Mbed)

Last updated at Posted at 2022-09-12

x mbed2リビジョン144
x リビジョンを変更できる人むけ

目的
AQM0802Aのテスト

1.SCLとSDAを接続
2.電源の接続
3.下記のソースコードを書き込む
4.コンパイル実行で表示されたら終了
5.おわり

o_con747.jpg





//I2C_LCD_HELLO_812_1

#include "mbed.h"

//AQM0802のI2Cアドレス
#define ADDR_LCD    (0x7C)      //  address

//i2c initialization
//       SDA    SCL
I2C i2c(P0_10, P0_11); //812

//AQM0802の初期化コード
char INIT_com[]= {
    0x0,0x38,
    0x0,0x39,
    0x0,0x4,
    0x0,0x14,
    0x0,0x70,
    0x0,0x56,
    0x0,0x6C,
    0x0,0x38,
    0x0,0xC,
    0x0,0x1,
    0x40,0x41
};

//AQM0802のクリアコード
char INIT_cls[]= {0x0,0x1};

//メイン関数
int main()
{
    //液晶の初期化
    wait_ms(200);
    for(int ii=0; ii<11; ii++) {
        i2c.write(ADDR_LCD, &INIT_com[ii*2], 2);
        wait_ms(3);
    } //for

    //無限ループ
    while (1) {
        //液晶のクリア
        i2c.write(ADDR_LCD,INIT_cls,2);
        wait_ms(3);

        //液晶に出力
        char a[]="@HELLO";
        i2c.write(ADDR_LCD, a, sizeof(a) );

        //1秒待つ
        wait_ms(1000);
    }//while
}//main






o_con833.jpg

-24-

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0