I2C 接続の LCD AQM1602XA-RN-GBW 用のライブラリの使用例. Demo program of library for LCD 1602XA-RN-GBW connected using I2C interface.
Dependencies: mbed UIT_AQM1602
main.cpp
- Committer:
- MikamiUitOpen
- Date:
- 2015-06-09
- Revision:
- 1:6c838e71e330
- Parent:
- 0:e1b05c7eb023
- Child:
- 2:6e609a28fa80
File content as of revision 1:6c838e71e330:
//------------------------------------------------------------ // Test program for LCD AQM1602XA-RN-GBW using I2C interface // Pullup resistors for SDA and SCL: 10 kΩ // 2015/06/09, Copyright (c) 2015 MIKAMI, Naoki //------------------------------------------------------------ #include "mbed.h" #include "AQM1602.hpp" using namespace Mikami; Aqm1602 lcd_; // Default, OK //Aqm1602 lcd_(D14, D15); // OK //Aqm1602 lcd_(D14, D15, 200000); // OK //Aqm1602 lcd_(D14, D15, 200000, true, true); // OK //Aqm1602 lcd_(PB_3, PB_10); // OK //Aqm1602 lcd_(PC_9, PA_8); // OK //Aqm1602 lcd_(PB_4, PA_8); // OK Ticker timer_; DigitalIn uButton_(USER_BUTTON); // Display 0, 1, 2, ..... void TimerIsr() { static int k = 0; char str[10]; sprintf(str, "%d", k++); lcd_.WriteStringXY(str, 0, 1); } void WaitButton() { lcd_.WriteStringXY("Push blue button", 0, 1); while (uButton_ == 1) {} lcd_.ClearLine(1); wait(0.5); } int main() { lcd_.Clear(); lcd_.WriteString("Hello!"); WaitButton(); // Waiting, push blue user button lcd_.WriteStringXY("0123456789ABCDEF", 0, 0); WaitButton(); // Waiting, push blue user button lcd_.ClearLine(0); WaitButton(); // Waiting, push blue user button string str = "AQM1602"; lcd_.WriteStringXY(str+"XA-RN-GBW", 0, 0); TimerIsr(); timer_.attach(&TimerIsr, 1); while (true) {} }