LCDモジュール ACM1602NI(I2C接続) を制御するライブラリ
Dependents: scan2 BoxController
Diff: LcdAcm1602ni.cpp
- Revision:
- 11:e0849411adfa
- Parent:
- 10:4ceccdba0248
--- a/LcdAcm1602ni.cpp Thu Dec 15 16:05:57 2016 +0000 +++ b/LcdAcm1602ni.cpp Fri Dec 16 07:48:22 2016 +0000 @@ -10,6 +10,20 @@ :m_pinSDA(pinSDA) ,m_pinSCL(pinSCL) ,m_i2c(pinSDA, pinSCL) + ,m_isMyI2c(true) + ,m_currentLineNo(0) + ,m_currentCharaNo(0) + ,m_displayVisible(true) + ,m_cursorVisible(false) + ,m_blinkEnable(false) +{ + m_i2c.frequency(I2C_MAX_FREQUENCY); +} +LcdAcm1602ni::LcdAcm1602ni(I2C& i2c) + :m_pinSDA(NC) + ,m_pinSCL(NC) + ,m_i2c(i2c) + ,m_isMyI2c(false) ,m_currentLineNo(0) ,m_currentCharaNo(0) ,m_displayVisible(true) @@ -28,9 +42,6 @@ */ void LcdAcm1602ni::initialize() { - // I2C通信の周波数設定 - m_i2c.frequency(I2C_MAX_FREQUENCY); - uint8_t command; // 画面クリア(00000001 = 0x01)