Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MAIN.cpp
00001 /**************************************************** 00002 * FAST PROTOTYPING WITH NUCLEO * 00003 * Example Code 05: LCDdisplay * 00004 * Author: Mauro D'Angelo * 00005 * Organization: Perlatecnica no-profit organization * 00006 *****************************************************/ 00007 00008 #include "mbed.h" 00009 #include "TextLCD.h" 00010 00011 00012 // PCF8574T 00013 //#define SLAVEADDRESS 0x4E 00014 //PCF8574AT 00015 #define SLAVEADDRESS 0x7E 00016 00017 // Instanzia un oggetto I2C assegnando i due pin SDA ed SCL 00018 I2C i2c_lcd(PB_9,PB_8); // SDA, SCL 00019 00020 // Instanzia un oggetto TextLCD_I2C per la gestione del display via I2Cbus 00021 TextLCD_I2C lcd(&i2c_lcd,SLAVEADDRESS, TextLCD::LCD16x2); // I2C exp: I2C bus, PCF8574AT Slaveaddress, LCD Type 00022 00023 //0x7e, 00024 int main() { 00025 // Spegne il cursore 00026 lcd.setCursor(TextLCD::CurOff_BlkOff); 00027 00028 // Pulisce lo schermo 00029 lcd.cls(); 00030 00031 // Stampa sullo schermo 00032 lcd.printf("scherzo:"); 00033 00034 // punta alla prima colonna del secondo rigo del display 00035 lcd.setAddress(0, 1); 00036 00037 // Stampa sullo schermo 00038 lcd.printf("<3"); 00039 wait(2); 00040 }
Generated on Fri Jul 22 2022 17:53:50 by
1.7.2