Browse Source

Testprogramme aktualisiert

Tobias Müller 5 years ago
parent
commit
068433de4f

+ 41 - 42
examples/Test_HSA_LCD_Shield_V5/Test_HSA_LCD_Shield_V5.ino

@@ -1,7 +1,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 //                                                                            //
-// Programname: Test_HSA_LCD_Shield                                           //
-// Date: 04.05.2018                                                           //
+// Programname: Test_HSA_LCD_Shield_V5                                        //
+// Date: 28.11.2018                                                           //
 // Description: Program to test the LCD-Shield, which was build in Elektro-   //
 //              nikdesign.                                                    //
 //                                                                            //
@@ -25,7 +25,7 @@
 ////////////////////            Global Variable             ////////////////////
 ////////////////////////////////////////////////////////////////////////////////
 
-HSA_LCD_Shield LCD = HSA_LCD_Shield(); // Create object of class HSA_LCD_Shield
+HSA_LCD_Shield LCD(LCD_VERSION_5); // Create object of class HSA_LCD_Shield
 
 ////////////////////////////////////////////////////////////////////////////////
 ////////////////////            Setup Function              ////////////////////
@@ -72,9 +72,8 @@ void setup(void) {
   if(config) {
 
     // Print welcome message on LC-Display
-    LCD.write4Rows("Hochschule  Anhalt\n  FB EMW\nPress Key!");
-
-        
+    LCD.writeRow("Hochschule  Anhalt\n  FB EMW\nPress Key!");
+  
     // Turn LCD-Backlight on
     LCD.lcdBacklight(true);
 
@@ -118,21 +117,21 @@ void loop(void) {
   while(LCD.getButton() == false) {
 
     // Turn off LEDs
-    LCD.controlLed(LED_GREEN,false);
-    LCD.controlLed(LED_RED,false);
+    LCD.controlLED(LED_GREEN,false);
+    LCD.controlLED(LED_RED,false);
 
     // Print welcome message on LC-Display
-    LCD.write4Rows("Hochschule  Anhalt\n  FB EMW\nPress Key!");
+    LCD.writeRow("Hochschule  Anhalt\n  FB EMW\nPress Key!");
 
     // Animate the third and fourth row 
-    LCD.writeRow4("");
+    LCD.writeRow(0x03, "");
     delay(200);
-    LCD.writeRow3("> FB EMW <");
+    LCD.writeRow(0x03, "> FB EMW <");
     delay(200);
-    LCD.writeRow3(">>FB EMW<<");
-    LCD.writeRow4("Press Key!");
+    LCD.writeRow(0x03, ">>FB EMW<<");
+    LCD.writeRow(0x04, "Press Key!");
     delay(200);
-    LCD.writeRow3(" >FB EMW<");
+    LCD.writeRow(0x03, " >FB EMW<");
     delay(200);
     
   }
@@ -141,17 +140,17 @@ void loop(void) {
   while(LCD.getButton() == BUTTON_UP) {
 
     // Show which button is pressed
-    LCD.writeRow1("button");
-    LCD.writeRow2("up     *");
-    LCD.writeRow3("      0 0");
-    LCD.writeRow4("       0");
+    LCD.writeRow(0x01, "button");
+    LCD.writeRow(0x02, "up     *");
+    LCD.writeRow(0x03, "      0 0");
+    LCD.writeRow(0x04, "       0");
 
     // Let LED red and green blink
-    LCD.controlLed(LED_GREEN,true);
-    LCD.controlLed(LED_RED,true);
+    LCD.controlLED(LED_GREEN,true);
+    LCD.controlLED(LED_RED,true);
     delay(200);
-    LCD.controlLed(LED_GREEN,false);
-    LCD.controlLed(LED_RED,false);
+    LCD.controlLED(LED_GREEN,false);
+    LCD.controlLED(LED_RED,false);
     delay(200);
 
   }
@@ -160,15 +159,15 @@ void loop(void) {
   while(LCD.getButton() == BUTTON_RIGHT) {
 
     // Show which button is pressed
-    LCD.writeRow1("button");
-    LCD.writeRow2("right  0");
-    LCD.writeRow3("      0 *");
-    LCD.writeRow4("       0");
+    LCD.writeRow(0x01, "button");
+    LCD.writeRow(0x02, "right  0");
+    LCD.writeRow(0x03, "      0 *");
+    LCD.writeRow(0x04, "       0");
 
     // Let LED red blink
-    LCD.controlLed(LED_RED,true);
+    LCD.controlLED(LED_RED,true);
     delay(200);
-    LCD.controlLed(LED_RED,false);
+    LCD.controlLED(LED_RED,false);
     delay(200);
 
   }
@@ -177,17 +176,17 @@ void loop(void) {
   while(LCD.getButton() == BUTTON_DOWN) {
 
     // Show which button is pressed
-    LCD.writeRow1("button");
-    LCD.writeRow2("down   0");
-    LCD.writeRow3("      0 0");
-    LCD.writeRow4("       *");
+    LCD.writeRow(0x01, "button");
+    LCD.writeRow(0x02, "down   0");
+    LCD.writeRow(0x03, "      0 0");
+    LCD.writeRow(0x04, "       *");
 
     // Let LED red and green blink differently
-    LCD.controlLed(LED_GREEN,false);
-    LCD.controlLed(LED_RED,true);
+    LCD.controlLED(LED_GREEN,false);
+    LCD.controlLED(LED_RED,true);
     delay(200);
-    LCD.controlLed(LED_GREEN,true);
-    LCD.controlLed(LED_RED,false);
+    LCD.controlLED(LED_GREEN,true);
+    LCD.controlLED(LED_RED,false);
     delay(200);
 
   }
@@ -196,15 +195,15 @@ void loop(void) {
   while(LCD.getButton() == BUTTON_LEFT) {
 
     // Show which left is pressed
-    LCD.writeRow1("button");
-    LCD.writeRow2("left   0");
-    LCD.writeRow3("      * 0");
-    LCD.writeRow4("       0");
+    LCD.writeRow(0x01, "button");
+    LCD.writeRow(0x02, "left   0");
+    LCD.writeRow(0x03, "      * 0");
+    LCD.writeRow(0x04, "       0");
 
     // Let LED green blink
-    LCD.controlLed(LED_GREEN,true);
+    LCD.controlLED(LED_GREEN,true);
     delay(200);
-    LCD.controlLed(LED_GREEN,false);
+    LCD.controlLED(LED_GREEN,false);
     delay(200);
 
   }

+ 41 - 42
examples/Test_HSA_LCD_Shield_V6/Test_HSA_LCD_Shield_V6.ino

@@ -1,7 +1,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 //                                                                            //
-// Programname: Test_HSA_LCD_Shield                                           //
-// Date: 04.05.2018                                                           //
+// Programname: Test_HSA_LCD_Shield_V6                                        //
+// Date: 28.11.2018                                                           //
 // Description: Program to test the LCD-Shield, which was build in Elektro-   //
 //              nikdesign.                                                    //
 //                                                                            //
@@ -25,7 +25,7 @@
 ////////////////////            Global Variable             ////////////////////
 ////////////////////////////////////////////////////////////////////////////////
 
-HSA_LCD_Shield LCD = HSA_LCD_Shield(); // Create object of class HSA_LCD_Shield
+HSA_LCD_Shield LCD(LCD_VERSION_6); // Create object of class HSA_LCD_Shield
 
 ////////////////////////////////////////////////////////////////////////////////
 ////////////////////            Setup Function              ////////////////////
@@ -72,9 +72,8 @@ void setup(void) {
   if(config) {
 
     // Print welcome message on LC-Display
-    LCD.write4Rows("Hochschule  Anhalt\n  FB EMW\nPress Key!");
-
-        
+    LCD.writeRow("Hochschule  Anhalt\n  FB EMW\nPress Key!");
+  
     // Turn LCD-Backlight on
     LCD.lcdBacklight(true);
 
@@ -118,21 +117,21 @@ void loop(void) {
   while(LCD.getButton() == false) {
 
     // Turn off LEDs
-    LCD.controlLed(LED_GREEN,false);
-    LCD.controlLed(LED_RED,false);
+    LCD.controlLED(LED_GREEN,false);
+    LCD.controlLED(LED_RED,false);
 
     // Print welcome message on LC-Display
-    LCD.write4Rows("Hochschule  Anhalt\n  FB EMW\nPress Key!");
+    LCD.writeRow("Hochschule  Anhalt\n  FB EMW\nPress Key!");
 
     // Animate the third and fourth row 
-    LCD.writeRow4("");
+    LCD.writeRow(0x03, "");
     delay(200);
-    LCD.writeRow3("> FB EMW <");
+    LCD.writeRow(0x03, "> FB EMW <");
     delay(200);
-    LCD.writeRow3(">>FB EMW<<");
-    LCD.writeRow4("Press Key!");
+    LCD.writeRow(0x03, ">>FB EMW<<");
+    LCD.writeRow(0x04, "Press Key!");
     delay(200);
-    LCD.writeRow3(" >FB EMW<");
+    LCD.writeRow(0x03, " >FB EMW<");
     delay(200);
     
   }
@@ -141,17 +140,17 @@ void loop(void) {
   while(LCD.getButton() == BUTTON_UP) {
 
     // Show which button is pressed
-    LCD.writeRow1("button");
-    LCD.writeRow2("up     *");
-    LCD.writeRow3("      0 0");
-    LCD.writeRow4("       0");
+    LCD.writeRow(0x01, "button");
+    LCD.writeRow(0x02, "up     *");
+    LCD.writeRow(0x03, "      0 0");
+    LCD.writeRow(0x04, "       0");
 
     // Let LED red and green blink
-    LCD.controlLed(LED_GREEN,true);
-    LCD.controlLed(LED_RED,true);
+    LCD.controlLED(LED_GREEN,true);
+    LCD.controlLED(LED_RED,true);
     delay(200);
-    LCD.controlLed(LED_GREEN,false);
-    LCD.controlLed(LED_RED,false);
+    LCD.controlLED(LED_GREEN,false);
+    LCD.controlLED(LED_RED,false);
     delay(200);
 
   }
@@ -160,15 +159,15 @@ void loop(void) {
   while(LCD.getButton() == BUTTON_RIGHT) {
 
     // Show which button is pressed
-    LCD.writeRow1("button");
-    LCD.writeRow2("right  0");
-    LCD.writeRow3("      0 *");
-    LCD.writeRow4("       0");
+    LCD.writeRow(0x01, "button");
+    LCD.writeRow(0x02, "right  0");
+    LCD.writeRow(0x03, "      0 *");
+    LCD.writeRow(0x04, "       0");
 
     // Let LED red blink
-    LCD.controlLed(LED_RED,true);
+    LCD.controlLED(LED_RED,true);
     delay(200);
-    LCD.controlLed(LED_RED,false);
+    LCD.controlLED(LED_RED,false);
     delay(200);
 
   }
@@ -177,17 +176,17 @@ void loop(void) {
   while(LCD.getButton() == BUTTON_DOWN) {
 
     // Show which button is pressed
-    LCD.writeRow1("button");
-    LCD.writeRow2("down   0");
-    LCD.writeRow3("      0 0");
-    LCD.writeRow4("       *");
+    LCD.writeRow(0x01, "button");
+    LCD.writeRow(0x02, "down   0");
+    LCD.writeRow(0x03, "      0 0");
+    LCD.writeRow(0x04, "       *");
 
     // Let LED red and green blink differently
-    LCD.controlLed(LED_GREEN,false);
-    LCD.controlLed(LED_RED,true);
+    LCD.controlLED(LED_GREEN,false);
+    LCD.controlLED(LED_RED,true);
     delay(200);
-    LCD.controlLed(LED_GREEN,true);
-    LCD.controlLed(LED_RED,false);
+    LCD.controlLED(LED_GREEN,true);
+    LCD.controlLED(LED_RED,false);
     delay(200);
 
   }
@@ -196,15 +195,15 @@ void loop(void) {
   while(LCD.getButton() == BUTTON_LEFT) {
 
     // Show which left is pressed
-    LCD.writeRow1("button");
-    LCD.writeRow2("left   0");
-    LCD.writeRow3("      * 0");
-    LCD.writeRow4("       0");
+    LCD.writeRow(0x01, "button");
+    LCD.writeRow(0x02, "left   0");
+    LCD.writeRow(0x03, "      * 0");
+    LCD.writeRow(0x04, "       0");
 
     // Let LED green blink
-    LCD.controlLed(LED_GREEN,true);
+    LCD.controlLED(LED_GREEN,true);
     delay(200);
-    LCD.controlLed(LED_GREEN,false);
+    LCD.controlLED(LED_GREEN,false);
     delay(200);
 
   }