Tenga Raffy

Dependencies:   TextLCD mbed

Fork of STMNucleoF401RE_ExampleCode_05_LCD by Corso Rapid Prototyping with STM32Nucleo

main.cpp

Committer:
LorenzoCR
Date:
2017-06-10
Revision:
5:d261737139c5
Parent:
4:b95e3e1f207e

File content as of revision 5:d261737139c5:

/****************************************************
*            FAST PROTOTYPING WITH NUCLEO           *
* Example Code 05: LCDdisplay                       *
* Author: Mauro D'Angelo                            *
* Organization: Perlatecnica no-profit organization *  
*****************************************************/

#include "mbed.h"
#include "TextLCD.h"

// 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);
    
    // Pulisce lo schermo
    lcd.cls();
    
    // Stampa sullo schermo
    for (int I=0; I<=12; I++){
    lcd.setAddress(I, 0);
    lcd.printf("Sono");
    
    // punta alla prima colonna del secondo rigo del display
    lcd.setAddress(0, 1);
    
    // Stampa sullo schermo
    lcd.printf("Tammaro");
    wait(1);}
    
}