Team Alpha / Mbed 2 deprecated UserIntefaceLCD

Dependencies:   mbed mbed-rtos MLX90614

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Compass.h Source File

Compass.h

00001 #ifndef _COMPASS_H
00002 #define _COMPASS_H
00003 
00004 #include "Item.h"
00005 #include <stdio.h>
00006 
00007 //math stuff
00008 #define _USE_MATH_DEFINES
00009 #include <math.h>
00010 #define M_PI 3.14159265358979323846  /* pi */
00011 
00012 //define center coordinates
00013 #define X_CENTER 95
00014 #define Y_CENTER 35
00015 #define POINTER_LENGTH 10
00016 #define RADIUS 19
00017 
00018 class Compass: public Item {
00019     public:
00020         //inherited functions
00021         virtual void display(void);
00022         virtual void update(char c);
00023         
00024         //constructor
00025         Compass(ST7565 *lcd, Item *back, DigitalOut *gyro, DigitalOut *thermo);
00026         
00027     private:
00028         Thread *ct; //compass update thread
00029         
00030         //helper functions
00031         DigitalOut *gyro, *thermo;
00032         void draw_compass(double degrees);
00033         static void ct_start(void const *args);
00034         void compass_update(void);
00035 };
00036 
00037 #endif