LCD implementation of our project.
Dependencies: mbed mbed-rtos MLX90614
Compass.h@5:5b1a8ad6c187, 2015-05-28 (annotated)
- Committer:
- ovidiup13
- Date:
- Thu May 28 16:07:00 2015 +0000
- Revision:
- 5:5b1a8ad6c187
- Parent:
- 4:024e6a9c2ebf
- Child:
- 7:11675c1dce4f
added levelmeter functionality and threading
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ovidiup13 | 3:688b62ff6474 | 1 | #ifndef _COMPASS_H |
ovidiup13 | 3:688b62ff6474 | 2 | #define _COMPASS_H |
ovidiup13 | 3:688b62ff6474 | 3 | |
ovidiup13 | 3:688b62ff6474 | 4 | #include "Item.h" |
ovidiup13 | 4:024e6a9c2ebf | 5 | #include <stdio.h> |
ovidiup13 | 3:688b62ff6474 | 6 | #define _USE_MATH_DEFINES |
ovidiup13 | 3:688b62ff6474 | 7 | #include <math.h> |
ovidiup13 | 3:688b62ff6474 | 8 | #define M_PI 3.14159265358979323846 /* pi */ |
ovidiup13 | 3:688b62ff6474 | 9 | |
ovidiup13 | 3:688b62ff6474 | 10 | //define center coordinates |
ovidiup13 | 3:688b62ff6474 | 11 | #define X_CENTER 95 |
ovidiup13 | 3:688b62ff6474 | 12 | #define Y_CENTER 35 |
ovidiup13 | 3:688b62ff6474 | 13 | #define POINTER_LENGTH 10 |
ovidiup13 | 3:688b62ff6474 | 14 | #define RADIUS 19 |
ovidiup13 | 3:688b62ff6474 | 15 | |
ovidiup13 | 3:688b62ff6474 | 16 | class Compass: public Item { |
ovidiup13 | 3:688b62ff6474 | 17 | public: |
ovidiup13 | 4:024e6a9c2ebf | 18 | //inherited functions |
ovidiup13 | 3:688b62ff6474 | 19 | virtual void display(void); |
ovidiup13 | 3:688b62ff6474 | 20 | virtual void update(char c); |
ovidiup13 | 3:688b62ff6474 | 21 | |
ovidiup13 | 4:024e6a9c2ebf | 22 | //constructor |
ovidiup13 | 4:024e6a9c2ebf | 23 | Compass(ST7565 *lcd, Item *back); |
ovidiup13 | 4:024e6a9c2ebf | 24 | |
ovidiup13 | 4:024e6a9c2ebf | 25 | private: |
ovidiup13 | 4:024e6a9c2ebf | 26 | Thread *ct; //compass update thread |
ovidiup13 | 4:024e6a9c2ebf | 27 | |
ovidiup13 | 4:024e6a9c2ebf | 28 | //helper functions |
ovidiup13 | 3:688b62ff6474 | 29 | void draw_compass(double degrees); |
ovidiup13 | 4:024e6a9c2ebf | 30 | static void ct_start(void const *args); |
ovidiup13 | 4:024e6a9c2ebf | 31 | void compass_update(void); |
ovidiup13 | 3:688b62ff6474 | 32 | }; |
ovidiup13 | 3:688b62ff6474 | 33 | |
ovidiup13 | 3:688b62ff6474 | 34 | #endif |