Sensor Data - first assignment CO838

Dependencies:   mbed C12832 FXOS8700Q LM75B eCompass_FPU_Lib

Sensor Data - Project developed by Jean-Paul Saysana (jls44)

First assignment for the Internet of Things and Mobile Devices CO838 module

University of Kent (2016-2017)

Functionalities:

- Temperature Sensor

- Compass

- Music box

- Potentiometer that changes LED colours

Libraries used: C12832, eCompass_FPU_Lib, FXOS8700Q, LM75B

Committer:
co838_jls44
Date:
Fri Feb 24 14:33:41 2017 +0000
Revision:
1:c54902f21aa8
Parent:
0:4b83b332b327
comment about the playnote method

Who changed what in which revision?

UserRevisionLine numberNew contents of line
co838_jls44 0:4b83b332b327 1 /* Developed by Jean-Paul Saysana - jls44 - MSc Student in Computer Security*/
co838_jls44 0:4b83b332b327 2 /* Internet of Things and Mobile Devices - CO838 University of Kent*/
co838_jls44 0:4b83b332b327 3 /* Class Compass */
co838_jls44 0:4b83b332b327 4 /* Inherit from the library eCompass class. It just has functions to get the compass' angle. */
co838_jls44 0:4b83b332b327 5 /* The eCompass library was developed by Jim Carver and can be found in: */
co838_jls44 0:4b83b332b327 6 /* https://developer.mbed.org/users/JimCarver/code/eCompass_Lib/ */
co838_jls44 0:4b83b332b327 7
co838_jls44 0:4b83b332b327 8 #ifndef COMPASS_H_
co838_jls44 0:4b83b332b327 9 #define COMPASS_H_
co838_jls44 0:4b83b332b327 10
co838_jls44 0:4b83b332b327 11 #include "FXOS8700Q.h"
co838_jls44 0:4b83b332b327 12 #include "eCompass_Lib.h"
co838_jls44 0:4b83b332b327 13
co838_jls44 0:4b83b332b327 14 /* Inherit the public eCompass class, to get the method to get the Angle. */
co838_jls44 0:4b83b332b327 15 class Compass : public eCompass {
co838_jls44 0:4b83b332b327 16 public:
co838_jls44 0:4b83b332b327 17 /* Get the address for the FXOS8700Q sensor */
co838_jls44 0:4b83b332b327 18 Compass(uint8_t addr);
co838_jls44 0:4b83b332b327 19 /* Destructor */
co838_jls44 0:4b83b332b327 20 ~Compass() {};
co838_jls44 0:4b83b332b327 21
co838_jls44 0:4b83b332b327 22 /* Get compass angle */
co838_jls44 0:4b83b332b327 23 float GetAngle() const;
co838_jls44 0:4b83b332b327 24 /* Get Axis and return compass angle */
co838_jls44 0:4b83b332b327 25 float GetCompass();
co838_jls44 0:4b83b332b327 26
co838_jls44 0:4b83b332b327 27
co838_jls44 0:4b83b332b327 28 private:
co838_jls44 0:4b83b332b327 29 /* Magnetometer sensor */
co838_jls44 0:4b83b332b327 30 FXOS8700QMagnetometer mag;
co838_jls44 0:4b83b332b327 31 /* Accelerometer sensor */
co838_jls44 0:4b83b332b327 32 FXOS8700QAccelerometer acc;
co838_jls44 0:4b83b332b327 33 /* motion data counts that will containt the raw values of the accelerometer and magnetometer */
co838_jls44 0:4b83b332b327 34 motion_data_counts_t acc_raw, mag_raw;
co838_jls44 0:4b83b332b327 35 };
co838_jls44 0:4b83b332b327 36
co838_jls44 0:4b83b332b327 37 #endif /* COMPASS_H_ */