LCD implementation of our project.

Dependencies:   mbed mbed-rtos MLX90614

Committer:
ovidiup13
Date:
Wed Jun 03 17:42:47 2015 +0000
Revision:
10:97389d774ae1
Parent:
8:81ed1135ba02
working version, comment out thermo in main;

Who changed what in which revision?

UserRevisionLine numberNew 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 7:11675c1dce4f 6
ovidiup13 7:11675c1dce4f 7 //math stuff
ovidiup13 3:688b62ff6474 8 #define _USE_MATH_DEFINES
ovidiup13 3:688b62ff6474 9 #include <math.h>
ovidiup13 3:688b62ff6474 10 #define M_PI 3.14159265358979323846 /* pi */
ovidiup13 3:688b62ff6474 11
ovidiup13 3:688b62ff6474 12 //define center coordinates
ovidiup13 3:688b62ff6474 13 #define X_CENTER 95
ovidiup13 3:688b62ff6474 14 #define Y_CENTER 35
ovidiup13 3:688b62ff6474 15 #define POINTER_LENGTH 10
ovidiup13 3:688b62ff6474 16 #define RADIUS 19
ovidiup13 3:688b62ff6474 17
ovidiup13 3:688b62ff6474 18 class Compass: public Item {
ovidiup13 3:688b62ff6474 19 public:
ovidiup13 4:024e6a9c2ebf 20 //inherited functions
ovidiup13 3:688b62ff6474 21 virtual void display(void);
ovidiup13 3:688b62ff6474 22 virtual void update(char c);
ovidiup13 3:688b62ff6474 23
ovidiup13 4:024e6a9c2ebf 24 //constructor
ovidiup13 8:81ed1135ba02 25 Compass(ST7565 *lcd, Item *back, DigitalOut *gyro, DigitalOut *thermo);
ovidiup13 4:024e6a9c2ebf 26
ovidiup13 4:024e6a9c2ebf 27 private:
ovidiup13 4:024e6a9c2ebf 28 Thread *ct; //compass update thread
ovidiup13 4:024e6a9c2ebf 29
ovidiup13 4:024e6a9c2ebf 30 //helper functions
ovidiup13 8:81ed1135ba02 31 DigitalOut *gyro, *thermo;
ovidiup13 3:688b62ff6474 32 void draw_compass(double degrees);
ovidiup13 4:024e6a9c2ebf 33 static void ct_start(void const *args);
ovidiup13 4:024e6a9c2ebf 34 void compass_update(void);
ovidiup13 3:688b62ff6474 35 };
ovidiup13 3:688b62ff6474 36
ovidiup13 3:688b62ff6474 37 #endif