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.
Revision 0:db398ab6f572, committed 2021-06-01
- Comitter:
- 221003975
- Date:
- Tue Jun 01 12:03:53 2021 +0000
- Commit message:
- MY FIRST PROGRAM WITH LCD by using push button
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BLINK-LCD.CPP Tue Jun 01 12:03:53 2021 +0000 @@ -0,0 +1,49 @@ +#include "mbed.h" +#include "C12832.h" + +DigitalIn pushButton(p9); + +C12832 lcd(SPI_MOSI, SPI_SCK, SPI_MISO, p8, p11); + +char ledBlinking[] = "Led is blinking"; + +// create an instance of LCD +static void display(char *lcdPrint) { + lcd.cls(); // Clear LCD + lcd.locate(3,5); // get cursor to position x=3px and y=5px + lcd.printf(lcdPrint); // Write text into LCD buffer + lcd.copy_to_lcd(); + // Clear LCD +} + + +DigitalOut led(LED1); +int i=0; + + void Blink(){ + + while(i<3){ + display(ledBlinking); + led = 0; + wait(0.5); + led = 1; + wait(0.5); + i++; + } + + led =0; + lcd.cls(); +} + +int main() { + while (1) { + + if(pushButton == 1) + { + Blink(); + } + i=0; + wait(0.5); + + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jun 01 12:03:53 2021 +0000 @@ -0,0 +1,12 @@ +#include "mbed.h" + +DigitalOut myled(LED1); + +int main() { + while(1) { + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Jun 01 12:03:53 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file