![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Demo program of UIT_ACM1602NI for use LCD on NucleoF401.
Dependencies: UIT_ACM1602NI mbed
Diff: main.cpp
- Revision:
- 0:d42990d2724c
- Child:
- 1:3563f4c06d9e
diff -r 000000000000 -r d42990d2724c main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Nov 08 10:03:32 2014 +0000 @@ -0,0 +1,39 @@ +//------------------------------------------------------------ +// Test program for LCD ACM1602NI using I2C interface +// Pullup resistors for SDA and SCL: 4.7 kΩ +// MIKAMI, Naoki (c) 2014/11/08 +//------------------------------------------------------------ + +#include "mbed.h" +#include "ACM1602NI.hpp" +using namespace Mikami; + +Acm1602Ni lcd_; // Default, OK +//Acm1602Ni lcd_(D14, D15); // OK +//Acm1602Ni lcd_(D14, D15, 200000); // OK +//Acm1602Ni lcd_(D14, D15, 200000, true, true); // OK +//Acm1602Ni lcd_(PB_3, PB_10); // OK +//Acm1602Ni lcd_(PC_9, PA_8); // OK +//Acm1602Ni lcd_(PB_4, PA_8); // OK + +Ticker timer_; + +// Display 0, 1, 2, ..... +void TimerIsr() +{ + static int k = 0; + char str[20]; + sprintf(str, "%d", k++); + lcd_.WriteStringXY(str, 0, 1); +} + +int main() +{ + lcd_.Clear(); + lcd_.WriteString("Hello World!"); + + TimerIsr(); + timer_.attach(&TimerIsr, 1); + + while (true) {} +}