sample program using TextLCD_ostream
Dependencies: TextLCD_ostream mbed
This is sample program using std::ostream with TextLCD
Because a large amount of memory is needed, it does not work in low memory MPU.
(It works fine on mbed LPC1768 and STM32 Nucleo-L476RG. But linker error occard on TG-LPC11U35-501)
main.cpp
- Committer:
- jk1lot
- Date:
- 2016-06-18
- Revision:
- 0:52f56aefba64
- Child:
- 1:2775f5dc2099
File content as of revision 0:52f56aefba64:
#include "mbed.h" #include "TextLCD_ostream.h" I2C i2c(p28,p27); // SDA, SCL TextLCD_I2C_N lcd(&i2c, ST7032_SA, TextLCD::LCD16x2, NC, TextLCD::ST7032_3V3); lcd_ostream lcds(&lcd); int main() { using namespace std; lcd.setContrast(32); while(true) { lcds << cls << "Hello world" << endl << "count: "; for(int i=3; i>=0; i--) { lcds.locate(8,1) << i; wait(1); } wait(3); lcds << cls; for(int i=0; i<10; i++) { lcds << "line:" << i << endl; wait(1); } wait(5); } }