A simple program to demonstrate how to use a RockerSW object on the 4D systems touch screen display with the mbed as a host microcontroller

Dependencies:   mbed

This is a demonstration program on how to use a 4D systems touch screen display with the mbed as a host microcontroller. For more information please take a look at the corresponding blog post here:

http://langster1980.blogspot.co.uk/2014/07/mbed-4d-systems-display-tutorial-with.html

Here is a photo of the breadboard layout and a schematic:

/media/uploads/langster1980/pwm_tutorial_schematic.png

/media/uploads/langster1980/mbed_breadboard_layout.jpg

Files at this revision

API Documentation at this revision

Comitter:
langster1980
Date:
Fri Jul 04 18:38:04 2014 +0000
Parent:
0:81f5d5b70036
Commit message:
1st commit

Changed in this revision

4dGENIE.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 81f5d5b70036 -r f16b26f664f9 4dGENIE.lib
--- a/4dGENIE.lib	Fri Jul 04 18:28:38 2014 +0000
+++ b/4dGENIE.lib	Fri Jul 04 18:38:04 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/chris215/code/4dGENIE/#bf1df2d55307
+http://mbed.org/users/langster1980/code/4dGENIE/#bf1df2d55307
diff -r 81f5d5b70036 -r f16b26f664f9 main.cpp
--- a/main.cpp	Fri Jul 04 18:28:38 2014 +0000
+++ b/main.cpp	Fri Jul 04 18:38:04 2014 +0000
@@ -42,7 +42,7 @@
 {
     genieFrame Event;
     lcd4d.genieDequeueEvent(&Event);
-    
+
     //event report from an object
     if(Event.reportObject.cmd == GENIE_REPORT_EVENT) {
         if (Event.reportObject.object == GENIE_OBJ_ROCKERSW) { // If the Reported Message was from a rocker switch
@@ -69,7 +69,7 @@
                 printf("SliderRead = %d \n\r", sliderRead);     // Display the Slider0 value
                 flashRate = 0.01;                               // Set flash rate initially to 10 ms On / Off
                 flashRate = 1 - (flashRate * sliderRead);       // Apply the value of slider0 object to flashRate
-                
+
 
             }
 
@@ -85,7 +85,7 @@
 
 {
     lcd4d.genieAttachEventHandler(&myGenieEventHandler);    // Call the event handler for the 4D display
- 
+
     lcd4d.genieWriteContrast(0);                            // Set the display contrast to 0 initially
 
     lcd4d.genieWriteContrast(15);                           // Set the display contrast to 15 (full brightness)
@@ -93,13 +93,13 @@
     printf("Langsters's mbed Visi-Genie LED Flash demo \n\r");  // Display a welcome message on the serial monitor
 
     while(1) {                                                  // initialise an infinite while loop
-        
+
         if(flag == 1) {                                          // Check if rockerSW object has been activated
             whiteLED = 1;                                        // turn real LED ON
             wait(flashRate);                                     // keep LED on for a short period of time
             whiteLED = 0;                                        // turn real LED ON
             wait(flashRate);                                     // turn LED off for a short period of time
-            
+
         }
 
         if(flag == 0) {                                          // Check if rockerSW object has been deactivated