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.
main.cpp
00001 #include "mbed.h" 00002 #include "C12832.h" 00003 00004 DigitalIn pushButton(p9); 00005 DigitalOut led(LED1); 00006 C12832 lcd(SPI_MOSI, SPI_SCK, SPI_MISO, p5, p6); 00007 00008 char ledBlinking[] = "Led is blinking"; 00009 00010 // create an instance of LCD 00011 static void display(char *lcdPrint) { 00012 lcd.cls(); // Clear LCD 00013 lcd.locate(3,5); // get cursor to position x=3px and y=5px 00014 lcd.printf(lcdPrint); // Write text into LCD buffer 00015 lcd.copy_to_lcd(); 00016 // Clear LCD 00017 } 00018 00019 void Blink(){ 00020 for(int i=0; i<3; i++){ 00021 display(ledBlinking); 00022 led=0; 00023 wait(0.5); 00024 led=1; 00025 wait(0.5); 00026 } 00027 led=0; 00028 lcd.cls(); 00029 } 00030 00031 int main() { 00032 while (1) { 00033 00034 if(pushButton == 1) 00035 { 00036 Blink(); 00037 } 00038 wait(0.5); 00039 00040 } 00041 }
Generated on Sat Oct 28 2023 17:32:45 by
1.7.2