Librarie pour ecran 128x32 de MyLab

Dependents:   MyLab_Lib

Files at this revision

API Documentation at this revision

Comitter:
lucas_favre
Date:
Tue Mar 29 20:46:43 2016 +0000
Parent:
13:337e207baca2
Commit message:
Suppression du menu -> Mis dans la librairie

Changed in this revision

menu.cpp Show diff for this revision Revisions of this file
menu.h Show diff for this revision Revisions of this file
--- a/menu.cpp	Tue Mar 29 20:29:20 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-# include"C12832.h"
-
-#include "MyLab_Lib.h"
-
- bool connected = false;
- char* joystickPos = "CENTRE";
- int blink_interval = 0;
- int select_app =0;
- static int menuItem =0;
-
-
-
-extern MyLab periph;
- void printMenu(int menuItem)
-   {
-       lcd.cls();
-       lcd.locate(0,0);
-       switch (menuItem)
-       {
-           case 0:
-               lcd.printf("mBed Librairie pour MyLab");
-               lcd.locate(0,16);
-               lcd.printf("Scroll with joystick");
-               break;
-           case 1:
-               lcd.printf("Lecture de deux notes");
-               lcd.locate(0,16);
-               lcd.printf("Click center to Start");
-               break;
-           case 2:
-               lcd.printf("Enregistrement audio");
-               lcd.locate(0,16);
-               lcd.printf("Click center to Start");
-               break;
-           case 3:
-        	   lcd.printf("Lecture valeur x acc");
-        	   lcd.locate(0,16);
-        	   lcd.printf("Click center to Start");
-        	   break;
-           case 4:
-          	 lcd.printf("Credits");
-          	 lcd.locate(0,16);
-          	 lcd.printf("Favre Lucas ITI3 Hepia ");
-          	 break;
-       }
-  }
- int setMenu()
- {
-	 char pos[6];
-	 periph.JoyStick_Position(pos);
-
-     if (strcmp(pos,"South") == 0)
-     {
-         joystickPos = "DOWN";
-         if (menuItem >= 0 && menuItem < 4)
-             printMenu(++menuItem);
-     }
-     else if (strcmp(pos,"Center") == 0){
-    	 if (menuItem == 1)
-    		 select_app = 1;
-    	 else if(menuItem == 2)
-    		 select_app = 2;
-    	 else if(menuItem == 3)
-			 select_app = 3;
-         joystickPos = "CLICK";
-     }
-     else if (strcmp(pos,"North") == 0)
-     {
-         joystickPos = "UP";
-         if (menuItem <= 4 && menuItem > 0)
-             printMenu(--menuItem);
-     }
-     return select_app;
- }
-
-
--- a/menu.h	Tue Mar 29 20:29:20 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-/*
- * menu.h
- *
- *  Created on: 3 mars 2016
- *      Author: lucas
- */
-
-#ifndef C12832_MENU_H_
-#define C12832_MENU_H_
-
-extern int select_app;
-
-
-void printMenu(int menuItem);
-int setMenu();
-void displayMessage(char* message);
-
-
-#endif /* C12832_MENU_H_ */
-