A basic library for the Freetronics arduino LCD shield.

Fork of freetronicsLCDShield by Koen Kempeneers

Revision:
6:ac481535732f
Parent:
5:fa933933ccd1
Child:
7:56d8df0eb209
diff -r fa933933ccd1 -r ac481535732f freetronicsLCDShield.h
--- a/freetronicsLCDShield.h	Sat Dec 13 09:22:05 2014 +0000
+++ b/freetronicsLCDShield.h	Sun Jul 02 15:05:19 2017 +0000
@@ -26,6 +26,9 @@
 #define LEFT  0
 #define RIGHT 1
 
+#define FREETRONICSLCDSHIELD_BUTTON_COUNT 5
+
+
 /** 
   * Provides full LCD support for the HD44780 compatible LCD on the arduino shaped shield.
   * http://www.freetronics.com/products/lcd-keypad-shield#.UnIr6_nkq0M
@@ -156,16 +159,29 @@
          */  
         void home(void);
         
+        typedef enum
+        {
+            None,
+            Left,
+            Down,
+            Up,
+            Right
+        } ShieldButton; 
+        
         /** Reads the status of the buttons
          * 
          * 
          */  
         float readButton(void);
              
+        ShieldButton pressedButton(void);     
+             
     protected:
         // Stream implementation functions
         virtual int _putc(int value);
         virtual int _getc();
+                
+        static const float buttonThresholds[FREETRONICSLCDSHIELD_BUTTON_COUNT];
 };
 
 #endif
\ No newline at end of file