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.
Fork of STMNucleoF401RE_ExampleCode_05_LCD by
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 // PCF8574T 00012 //define SLAVEADDRESS 0x4E 00013 //PCF8574AT 00014 #define SLAVEADDRESS 0x7E 00015 00016 // Instanzia un oggetto I2C assegnando i du pin SDA ed SCL 00017 I2C i2c_lcd(PB_9,PB_8); // SDA, SCL 00018 00019 // Instanzia un oggetto TextLCD_I2C per la gestione del display via I2Cbus 00020 TextLCD_I2C lcd(&i2c_lcd,SLAVEADDRESS, TextLCD::LCD16x2); // I2C exp: I2C bus, PCF8574AT Slaveaddress, LCD Type 00021 00022 //0x7e, 00023 int main() { 00024 // Spegne il cursore 00025 lcd.setCursor(TextLCD::CurOff_BlkOff); 00026 00027 // Pulisce lo schermo 00028 lcd.cls(); 00029 00030 // Stampa sullo schermo 00031 lcd.printf(" Welcome to"); 00032 00033 // punta alla prima colonna del secondo rigo del display 00034 lcd.setAddress(0, 1); 00035 00036 // Stampa sullo schermo 00037 lcd.printf("STM32 Testing"); 00038 wait(2); 00039 }
Generated on Fri Jul 15 2022 13:35:47 by
1.7.2
