Sensor library

Committer:
jmateo09
Date:
Wed May 15 13:44:30 2019 +0000
Revision:
0:7c37eb579038
Sensors

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jmateo09 0:7c37eb579038 1 #include "mbed.h"
jmateo09 0:7c37eb579038 2 #include "XBee.h"
jmateo09 0:7c37eb579038 3 #include "MODSERIAL.h"
jmateo09 0:7c37eb579038 4 #include "sstream"
jmateo09 0:7c37eb579038 5 #include "ADXL345_I2C.h"
jmateo09 0:7c37eb579038 6 #include "TextLCD.h"
jmateo09 0:7c37eb579038 7 #include "SDFileSystem.h"
jmateo09 0:7c37eb579038 8 #include "math.h"
jmateo09 0:7c37eb579038 9 #include "Setup.h"
jmateo09 0:7c37eb579038 10
jmateo09 0:7c37eb579038 11 #define PI 3.14159265
jmateo09 0:7c37eb579038 12
jmateo09 0:7c37eb579038 13 const int HallAddress = 0xBC; //0x5E <<1;
jmateo09 0:7c37eb579038 14 const int HallAddressWrite = 0x1;
jmateo09 0:7c37eb579038 15 const int LCDaddress = 0x40;
jmateo09 0:7c37eb579038 16 //float AccData[4];
jmateo09 0:7c37eb579038 17 //float MagData[4];
jmateo09 0:7c37eb579038 18 //float Temp;
jmateo09 0:7c37eb579038 19 //float Bat;
jmateo09 0:7c37eb579038 20
jmateo09 0:7c37eb579038 21 class Magnetic
jmateo09 0:7c37eb579038 22 {
jmateo09 0:7c37eb579038 23 public:
jmateo09 0:7c37eb579038 24 Magnetic();
jmateo09 0:7c37eb579038 25 I2C i2c;
jmateo09 0:7c37eb579038 26 void ReadMag(float *output);
jmateo09 0:7c37eb579038 27
jmateo09 0:7c37eb579038 28 private:
jmateo09 0:7c37eb579038 29
jmateo09 0:7c37eb579038 30 };
jmateo09 0:7c37eb579038 31
jmateo09 0:7c37eb579038 32 class Accelerometer
jmateo09 0:7c37eb579038 33 {
jmateo09 0:7c37eb579038 34 public:
jmateo09 0:7c37eb579038 35 Accelerometer();
jmateo09 0:7c37eb579038 36 ADXL345_I2C accelerometer;
jmateo09 0:7c37eb579038 37 void Init();
jmateo09 0:7c37eb579038 38 void ReadAcc(float *output);
jmateo09 0:7c37eb579038 39
jmateo09 0:7c37eb579038 40 private:
jmateo09 0:7c37eb579038 41
jmateo09 0:7c37eb579038 42 };
jmateo09 0:7c37eb579038 43
jmateo09 0:7c37eb579038 44 class Battery;
jmateo09 0:7c37eb579038 45 class LCD
jmateo09 0:7c37eb579038 46 {
jmateo09 0:7c37eb579038 47 public:
jmateo09 0:7c37eb579038 48 LCD();
jmateo09 0:7c37eb579038 49 I2C i2c_lcd;
jmateo09 0:7c37eb579038 50 TextLCD_I2C lcd;
jmateo09 0:7c37eb579038 51 IO ioSetup;
jmateo09 0:7c37eb579038 52 void Readlcd();
jmateo09 0:7c37eb579038 53 //////////////////////////////////LCD_RGB////////////////////////////////////////
jmateo09 0:7c37eb579038 54 void LCDR();
jmateo09 0:7c37eb579038 55 void LCDG();
jmateo09 0:7c37eb579038 56 void LCDB();
jmateo09 0:7c37eb579038 57 void LCDW();
jmateo09 0:7c37eb579038 58 void LCDOFF();
jmateo09 0:7c37eb579038 59 void RefreshLCD(float *AccData,float *Magdata);
jmateo09 0:7c37eb579038 60 private:
jmateo09 0:7c37eb579038 61
jmateo09 0:7c37eb579038 62 };
jmateo09 0:7c37eb579038 63
jmateo09 0:7c37eb579038 64 class Battery
jmateo09 0:7c37eb579038 65 {
jmateo09 0:7c37eb579038 66 public:
jmateo09 0:7c37eb579038 67 Battery();
jmateo09 0:7c37eb579038 68 //Battery Measuring
jmateo09 0:7c37eb579038 69 AnalogIn Battery_Status;
jmateo09 0:7c37eb579038 70 /////////////////////////////////Battery Voltage/////////////////////////////////
jmateo09 0:7c37eb579038 71 float GetBatteryVoltage();
jmateo09 0:7c37eb579038 72 private:
jmateo09 0:7c37eb579038 73 };