Home mbedmbed Examples ST Nucleo F334R8 LCD example

ST Nucleo F334R8 LCD example

by iainhendry71

In this example we will add an Arduino LCD shield to a ST Nucleo F334R8. This is a 16×2 LCD Keypad module for Arduino Diecimila Duemilanove, UNO, MEGA1280, MEGA2.

Here is a picture of this shield

lcd keypad shield

lcd keypad shield


The code is for the mBed online compiler at https://developer.mbed.org/ and uses the freetronics LCD library

#include "mbed.h"
#include "freetronicsLCDShield.h"
freetronicsLCDShield lcd(D8, D9, D4, D5, D6, D7, D1, A0);
int main() 
    // print the first line and wait 3 sec
    lcd.printf("LCD test");
    // print the counter prefix; the number will be printed in the while loop
    lcd.setCursorPosition(1, 0);
    lcd.printf("seconds : ");
    int i=1;
    while (i++) 
        lcd.setCursorPosition(1, 11);
        lcd.printf("%d", i);

You may also like