STM32F103C8のMbedでの液晶,AQM0802Aで「A」を表示
1.SCLとSDAを接続、プルアップも忘れずに
2.電源の接続
3.下記のソースコードを書き込む
4.コンパイル実行で表示されたら終了
5.おわり
#include "mbed.h"
#define ADDR (0x7C) // address
//I2C i2c(I2C_SDA, I2C_SCL);
I2C i2c(PB_7, PB_6);
//DigitalOut myled(LED1);
//Serial pc(SERIAL_TX, SERIAL_RX);
//volatile char TempCelsiusDisplay[] = "+abc.d C";
int main()
{
char data_read[2];
//init
wait(0.2);
data_read[0] = 0x0;
data_read[1]=0x38;
i2c.write(ADDR, data_read, 2);
data_read[1]=0x39;
i2c.write(ADDR, data_read, 2);
data_read[1]=0x14;
i2c.write(ADDR, data_read, 2);
data_read[1]=0x70;
i2c.write(ADDR, data_read, 2);
data_read[1]=0x56;
i2c.write(ADDR, data_read, 2);
data_read[1]=0x6C;
i2c.write(ADDR, data_read, 2);
wait(0.2);
data_read[1]=0x38;
i2c.write(ADDR, data_read, 2);
data_read[1]=0x0C;
i2c.write(ADDR, data_read, 2);
data_read[1]=0x01;
i2c.write(ADDR, data_read, 2);
wait(0.2);
data_read[0]='@';
data_read[1]='a';
i2c.write(ADDR, data_read, 2);
while (1) {
// Display result
// pc.printf("temp = %s\n", TempCelsiusDisplay);
// myled = !myled;
wait(2.0);
}
}
Author And Source
この問題について(STM32F103C8のMbedでの液晶,AQM0802Aで「A」を表示), 我々は、より多くの情報をここで見つけました https://qiita.com/caa45040/items/77ec3b325b5ac03910d3著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .