Rosette LUKONGE / Mbed 2 deprecated led_lcd

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
rosette
Date:
Thu Jun 03 09:55:43 2021 +0000
Commit message:
Version 2

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jun 03 09:55:43 2021 +0000
@@ -0,0 +1,41 @@
+#include "mbed.h"
+#include "C12832.h"
+
+DigitalIn pushButton(p9);
+DigitalOut led(LED1);
+C12832 lcd(SPI_MOSI, SPI_SCK, SPI_MISO, p5, p6); 
+
+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
+}
+
+    void Blink(){
+        for(int i=0; i<3; i++){
+            display(ledBlinking);
+            led=0;
+            wait(0.5);
+            led=1;
+            wait(0.5);
+        }
+        led=0;
+        lcd.cls();
+}
+
+int main() {
+    while (1) {
+        
+    if(pushButton == 1)
+    {
+        Blink();
+    }
+    wait(0.5);
+  
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jun 03 09:55:43 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file