PCD8544 Driver for an LCD with an PCD8544 controller (Nokia 3310).

Dependencies:   mbed pcd8544_drv

Files at this revision

API Documentation at this revision

Comitter:
carlosftm
Date:
Sun Jan 02 12:08:07 2011 +0000
Commit message:
Text support only

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
pcd8544_drv.lib 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	Sun Jan 02 12:08:07 2011 +0000
@@ -0,0 +1,54 @@
+/* ********************************************
+* PCD8544 Driver
+* This is a sample program to interface the
+* mbed microcontroller to an LCD with an PCD8544
+* driver using the pcd8544_drv library.
+*
+* Created on: 12/31/2010 at 19:48
+* Created by: CarlosFTM
+********************************************** */
+
+
+#include "mbed.h"
+#include "pcd8544_drv.hpp"
+
+DigitalOut myled(LED1);
+
+int main()
+{
+  /* Create a LCD interface*/
+  pcd8544 lcd(p21, p22, p23, p24, p27);
+
+  /* Initialize LCD & Clear screen*/
+  lcd.resetLCD();
+  lcd.initLCD();
+  lcd.clearLCD();
+  wait(0.5);
+
+  /* Fill the screen with a single character (14 * 6 = 84 characters) */
+  char count;
+  for (count = 0; count < (MAX_CHAR_X * MAX_CHAR_Y); count++)
+  {
+    lcd.writeChar('#');
+  }
+
+  /* Locate the cursor on line 3 and print a char string */
+  char message[] = ">PCD8544 LCD>";   // Define message string
+  char* message_p = message;         // Create a pointer
+  
+  lcd.setCursorXY(1,2);              // Locate the cursor on line 3
+                                     // (Line/Column count starts at 0)
+  
+  lcd.writeString(message_p);        // Write the string on the LCD
+  
+  /* Flash LED
+   * in infinite loop
+   */
+  while(1)
+  {
+    myled = !myled;
+    wait(0.05);
+    myled = !myled;
+    wait(0.5);
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Jan 02 12:08:07 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pcd8544_drv.lib	Sun Jan 02 12:08:07 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/carlosftm/code/pcd8544_drv/#9948e71af151