LCD implementation of our project.

Dependencies:   mbed mbed-rtos MLX90614

Committer:
ovidiup13
Date:
Sun Apr 26 16:29:53 2015 +0000
Revision:
3:688b62ff6474
Child:
8:81ed1135ba02
added screens for interacting with other components. i.e. distance, thermo, gyro, compass, etc. Need to complete settings screen and create threads for interacting with other code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ovidiup13 3:688b62ff6474 1 #include "Item.h"
ovidiup13 3:688b62ff6474 2
ovidiup13 3:688b62ff6474 3 #define SELECTION_LINE 6
ovidiup13 3:688b62ff6474 4
ovidiup13 3:688b62ff6474 5 class Measure: public Item {
ovidiup13 3:688b62ff6474 6 public:
ovidiup13 3:688b62ff6474 7 //menu items - only 2 -> start and back
ovidiup13 3:688b62ff6474 8 Item **items[2];
ovidiup13 3:688b62ff6474 9 Item *next; //screen to go next
ovidiup13 3:688b62ff6474 10 bool hasResult;
ovidiup13 3:688b62ff6474 11
ovidiup13 3:688b62ff6474 12 //constructors
ovidiup13 3:688b62ff6474 13 Measure(char * title, ST7565 *lcd, Item *back){
ovidiup13 3:688b62ff6474 14 this->title = title;
ovidiup13 3:688b62ff6474 15 this->st7565 = lcd;
ovidiup13 3:688b62ff6474 16 this->back = back;
ovidiup13 3:688b62ff6474 17 backName = " Back";
ovidiup13 3:688b62ff6474 18 hasResult = false;
ovidiup13 3:688b62ff6474 19 selected = 1;
ovidiup13 3:688b62ff6474 20 current_line = 6;
ovidiup13 3:688b62ff6474 21 };
ovidiup13 3:688b62ff6474 22
ovidiup13 3:688b62ff6474 23 Measure();
ovidiup13 3:688b62ff6474 24
ovidiup13 3:688b62ff6474 25 //inherited functions
ovidiup13 3:688b62ff6474 26 virtual void display();
ovidiup13 3:688b62ff6474 27 virtual void update(char c);
ovidiup13 3:688b62ff6474 28
ovidiup13 3:688b62ff6474 29 //set next screen
ovidiup13 3:688b62ff6474 30 void setNext(char * t, Item *item){
ovidiup13 3:688b62ff6474 31 this->nextName = t;
ovidiup13 3:688b62ff6474 32 this->next = item;
ovidiup13 3:688b62ff6474 33 }
ovidiup13 3:688b62ff6474 34
ovidiup13 3:688b62ff6474 35 //set description of screen
ovidiup13 3:688b62ff6474 36 void setDescription(char * description){
ovidiup13 3:688b62ff6474 37 this->description = description;
ovidiup13 3:688b62ff6474 38 }
ovidiup13 3:688b62ff6474 39
ovidiup13 3:688b62ff6474 40 //function to set screen as result screen
ovidiup13 3:688b62ff6474 41 void setResult(bool r){
ovidiup13 3:688b62ff6474 42 hasResult = r;
ovidiup13 3:688b62ff6474 43 }
ovidiup13 3:688b62ff6474 44
ovidiup13 3:688b62ff6474 45 private:
ovidiup13 3:688b62ff6474 46 int selected, current_line;
ovidiup13 3:688b62ff6474 47 char * description, *nextName, *backName;
ovidiup13 3:688b62ff6474 48 void display_description(char *r);
ovidiup13 3:688b62ff6474 49 void set_selected(int s);
ovidiup13 3:688b62ff6474 50 void display_result(double result);
ovidiup13 3:688b62ff6474 51 void display_items(void);
ovidiup13 3:688b62ff6474 52 };