LCD implementation of our project.
Dependencies: mbed mbed-rtos MLX90614
Measure.h@8:81ed1135ba02, 2015-06-03 (annotated)
- Committer:
- ovidiup13
- Date:
- Wed Jun 03 16:37:21 2015 +0000
- Revision:
- 8:81ed1135ba02
- Parent:
- 3:688b62ff6474
done something, idk what
Who changed what in which revision?
User | Revision | Line number | New 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 | 8:81ed1135ba02 | 7 | //constructor for thermometer |
ovidiup13 | 8:81ed1135ba02 | 8 | Measure(char * title, ST7565 *lcd, Item *back, DigitalOut *laser){ |
ovidiup13 | 3:688b62ff6474 | 9 | this->title = title; |
ovidiup13 | 3:688b62ff6474 | 10 | this->st7565 = lcd; |
ovidiup13 | 3:688b62ff6474 | 11 | this->back = back; |
ovidiup13 | 3:688b62ff6474 | 12 | backName = " Back"; |
ovidiup13 | 3:688b62ff6474 | 13 | hasResult = false; |
ovidiup13 | 3:688b62ff6474 | 14 | selected = 1; |
ovidiup13 | 3:688b62ff6474 | 15 | current_line = 6; |
ovidiup13 | 8:81ed1135ba02 | 16 | isOn = false; |
ovidiup13 | 8:81ed1135ba02 | 17 | this->laser = laser; |
ovidiup13 | 3:688b62ff6474 | 18 | }; |
ovidiup13 | 3:688b62ff6474 | 19 | |
ovidiup13 | 8:81ed1135ba02 | 20 | //Measure(char *title, ST7565, *lcd, Item *back, DigitalOut *laser); |
ovidiup13 | 8:81ed1135ba02 | 21 | //Measure(char * title, ST7565 *lcd, Item *back); |
ovidiup13 | 8:81ed1135ba02 | 22 | //constructor for thermometer |
ovidiup13 | 8:81ed1135ba02 | 23 | //Measure(char *title, ST7565 *lcd, Item *back, DigitalOut *gyro, DigitalOut *thermo); |
ovidiup13 | 3:688b62ff6474 | 24 | Measure(); |
ovidiup13 | 3:688b62ff6474 | 25 | |
ovidiup13 | 3:688b62ff6474 | 26 | //inherited functions |
ovidiup13 | 3:688b62ff6474 | 27 | virtual void display(); |
ovidiup13 | 3:688b62ff6474 | 28 | virtual void update(char c); |
ovidiup13 | 3:688b62ff6474 | 29 | |
ovidiup13 | 3:688b62ff6474 | 30 | //set next screen |
ovidiup13 | 3:688b62ff6474 | 31 | void setNext(char * t, Item *item){ |
ovidiup13 | 3:688b62ff6474 | 32 | this->nextName = t; |
ovidiup13 | 3:688b62ff6474 | 33 | this->next = item; |
ovidiup13 | 3:688b62ff6474 | 34 | } |
ovidiup13 | 3:688b62ff6474 | 35 | |
ovidiup13 | 3:688b62ff6474 | 36 | //set description of screen |
ovidiup13 | 3:688b62ff6474 | 37 | void setDescription(char * description){ |
ovidiup13 | 3:688b62ff6474 | 38 | this->description = description; |
ovidiup13 | 3:688b62ff6474 | 39 | } |
ovidiup13 | 3:688b62ff6474 | 40 | |
ovidiup13 | 3:688b62ff6474 | 41 | //function to set screen as result screen |
ovidiup13 | 3:688b62ff6474 | 42 | void setResult(bool r){ |
ovidiup13 | 3:688b62ff6474 | 43 | hasResult = r; |
ovidiup13 | 3:688b62ff6474 | 44 | } |
ovidiup13 | 3:688b62ff6474 | 45 | |
ovidiup13 | 3:688b62ff6474 | 46 | private: |
ovidiup13 | 8:81ed1135ba02 | 47 | //digital outputs for controlling stuff |
ovidiup13 | 8:81ed1135ba02 | 48 | DigitalOut *laser; |
ovidiup13 | 8:81ed1135ba02 | 49 | |
ovidiup13 | 8:81ed1135ba02 | 50 | //menu items - only 2 -> start and back |
ovidiup13 | 8:81ed1135ba02 | 51 | Item **items[2]; |
ovidiup13 | 8:81ed1135ba02 | 52 | Item *next; //screen to go next |
ovidiup13 | 8:81ed1135ba02 | 53 | |
ovidiup13 | 8:81ed1135ba02 | 54 | |
ovidiup13 | 8:81ed1135ba02 | 55 | bool hasResult, isOn; |
ovidiup13 | 8:81ed1135ba02 | 56 | |
ovidiup13 | 3:688b62ff6474 | 57 | int selected, current_line; |
ovidiup13 | 3:688b62ff6474 | 58 | char * description, *nextName, *backName; |
ovidiup13 | 3:688b62ff6474 | 59 | void display_description(char *r); |
ovidiup13 | 3:688b62ff6474 | 60 | void set_selected(int s); |
ovidiup13 | 3:688b62ff6474 | 61 | void display_result(double result); |
ovidiup13 | 3:688b62ff6474 | 62 | void display_items(void); |
ovidiup13 | 3:688b62ff6474 | 63 | }; |