Lib textLCD
Dependencies: mbed
Revision 2:78d57ebcfc3d, committed 2015-11-02
- Comitter:
- perlatecnica
- Date:
- Mon Nov 02 13:53:31 2015 +0000
- Parent:
- 1:e3538c234a60
- Commit message:
- v1.0
Changed in this revision
diff -r e3538c234a60 -r 78d57ebcfc3d TextLCD.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Mon Nov 02 13:53:31 2015 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/perlatecnica/code/TextLCD/#b4ec0bc9d921
diff -r e3538c234a60 -r 78d57ebcfc3d main.cpp --- a/main.cpp Mon Feb 17 22:16:24 2014 +0000 +++ b/main.cpp Mon Nov 02 13:53:31 2015 +0000 @@ -1,18 +1,39 @@ -#include "mbed.h" +/**************************************************** +* FAST PROTOTYPING WITH NUCLEO * +* Example Code 05: LCDdisplay * +* Author: Mauro D'Angelo * +* Organization: Perlatecnica no-profit organization * +*****************************************************/ -PwmOut mypwm(PWM_OUT); +#include "mbed.h" +#include "TextLCD.h" -DigitalOut myled(LED1); +// PCF8574T +#define SLAVEADDRESS 0x4E +//PCF8574AT +//#define SLAVEADDRESS 0x7E + +// Instanzia un oggetto I2C assegnando i du pin SDA ed SCL +I2C i2c_lcd(PB_9,PB_8); // SDA, SCL +// Instanzia un oggetto TextLCD_I2C per la gestione del display via I2Cbus +TextLCD_I2C lcd(&i2c_lcd,SLAVEADDRESS, TextLCD::LCD16x2); // I2C exp: I2C bus, PCF8574AT Slaveaddress, LCD Type + +//0x7e, int main() { + // Spegne il cursore + lcd.setCursor(TextLCD::CurOff_BlkOff); - mypwm.period_ms(10); - mypwm.pulsewidth_ms(1); - - printf("pwm set to %.2f %%\n", mypwm.read() * 100); + // Pulisce lo schermo + lcd.cls(); + + // Stampa sullo schermo + lcd.printf(" Welcome to"); - while(1) { - myled = !myled; - wait(1); - } -} + // punta alla prima colonna del secondo rigo del display + lcd.setAddress(0, 1); + + // Stampa sullo schermo + lcd.printf("LCD display demo"); + wait(2); +} \ No newline at end of file
diff -r e3538c234a60 -r 78d57ebcfc3d mbed.bld --- a/mbed.bld Mon Feb 17 22:16:24 2014 +0000 +++ b/mbed.bld Mon Nov 02 13:53:31 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/ \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/34e6b704fe68 \ No newline at end of file