LCD Accelerometer with interrupt fault

Dependencies:   mbed

Committer:
Aubs
Date:
Wed May 12 20:40:52 2010 +0000
Revision:
0:298e8a54dc2d

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Aubs 0:298e8a54dc2d 1 #include "header.h"
Aubs 0:298e8a54dc2d 2
Aubs 0:298e8a54dc2d 3 extern int menu;
Aubs 0:298e8a54dc2d 4
Aubs 0:298e8a54dc2d 5 // Menu Counter
Aubs 0:298e8a54dc2d 6 void menuscroll(void){
Aubs 0:298e8a54dc2d 7 if (menu<4){
Aubs 0:298e8a54dc2d 8 menu++;}
Aubs 0:298e8a54dc2d 9 if (menu==3){
Aubs 0:298e8a54dc2d 10 menu=0;}
Aubs 0:298e8a54dc2d 11 }
Aubs 0:298e8a54dc2d 12
Aubs 0:298e8a54dc2d 13 // Select
Aubs 0:298e8a54dc2d 14 void Select(void){
Aubs 0:298e8a54dc2d 15 if (menu==0){
Aubs 0:298e8a54dc2d 16 lcd.background(0xFFFFFF);
Aubs 0:298e8a54dc2d 17 Graphic();
Aubs 0:298e8a54dc2d 18 }
Aubs 0:298e8a54dc2d 19 if (menu==1){
Aubs 0:298e8a54dc2d 20 lcd.background(0x000000);
Aubs 0:298e8a54dc2d 21 Precise();
Aubs 0:298e8a54dc2d 22 }
Aubs 0:298e8a54dc2d 23 if (menu==2){
Aubs 0:298e8a54dc2d 24 lcd.background(0x800080);
Aubs 0:298e8a54dc2d 25 calibrate();
Aubs 0:298e8a54dc2d 26
Aubs 0:298e8a54dc2d 27 }
Aubs 0:298e8a54dc2d 28 }
Aubs 0:298e8a54dc2d 29
Aubs 0:298e8a54dc2d 30 //Menu
Aubs 0:298e8a54dc2d 31 void menuscreen(void){
Aubs 0:298e8a54dc2d 32 while(1){
Aubs 0:298e8a54dc2d 33 lcd.cls();
Aubs 0:298e8a54dc2d 34 but1.fall(&menuscroll);
Aubs 0:298e8a54dc2d 35 if(menu==0){
Aubs 0:298e8a54dc2d 36 lcd.locate(0,14);
Aubs 0:298e8a54dc2d 37 lcd.printf("Graphical Mode");
Aubs 0:298e8a54dc2d 38 }
Aubs 0:298e8a54dc2d 39 if(menu==1){
Aubs 0:298e8a54dc2d 40 lcd.locate(0,14);
Aubs 0:298e8a54dc2d 41 lcd.printf("Precision Mode");
Aubs 0:298e8a54dc2d 42 }
Aubs 0:298e8a54dc2d 43 if(menu==2){
Aubs 0:298e8a54dc2d 44 lcd.locate(0,14);
Aubs 0:298e8a54dc2d 45 lcd.printf("Calibration Mode",0xE00000);
Aubs 0:298e8a54dc2d 46 }
Aubs 0:298e8a54dc2d 47
Aubs 0:298e8a54dc2d 48 // Select Button
Aubs 0:298e8a54dc2d 49 but2.fall(&Select);
Aubs 0:298e8a54dc2d 50 }
Aubs 0:298e8a54dc2d 51 }