Shylaja Mohanraj / Mbed 2 deprecated BlackBox

Dependencies:   TextLCD mbed

Fork of TextLCD_HelloWorld by Simon Ford

main.cpp

Committer:
amrita_arm19
Date:
2016-03-30
Revision:
5:6f2d3689b015
Parent:
4:0e5cead61795
Child:
6:5fcb9eb2a1f1

File content as of revision 5:6f2d3689b015:

// Hello World! for the TextLCD

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

TextLCD lcd(p15, p16, p17, p18, p19, p20, TextLCD::LCD16x2); // rs, e, d4-d7
Serial ftdi(USBTX, USBRX);
DigitalOut led1(LED1);
DigitalOut led2(LED2);
DigitalOut led3(LED3);
DigitalOut led4(LED4);

int time1=0;                         // button count 



int main() {
    lcd.printf("Welcome!\n");
    ftdi.printf("Enter LED on time:\r\n");
    ftdi.scanf("%d\n\r", &time1);
    ftdi.printf(":%d\n\r", time1);   
    
    
    while(1) 
    {  
    void cls();
    lcd.printf("LED on: %d\n", time1);
    led1=1;
    led2=1;
    led3=1;
    led4=1;
    wait(time1);
    led1=0;
    led2=0;
    led3=0;
    led4=0;
    wait(time1);
        }
}