A multifunctional and modular Firmware for Multitech's mDot based on ARM mBed provides a widerange of functionality for several Sensors such as MAX44009, BME280, MPU9250, SI1143 and uBlox. It allows you to quickly build a Sensornode that measures specific data with its sensors and sends it via LoRaWAN.
Dependencies: mDot_LoRa_Sensornode_Flowmeter_impl mbed-rtos mbed
TaskAcceleration.h
00001 /** 00002 * @file TaskAcceleration.h 00003 * 00004 * @author Adrian 00005 * @date 30.05.2016 00006 * 00007 */ 00008 #include "MPU9250.h " 00009 #include "MPU9250AccelerationMessage.h " 00010 #include "main.h" 00011 #include "Task.h" 00012 00013 #ifndef TASKACCELERATION_H_ 00014 #define TASKACCELERATION_H_ 00015 00016 /** 00017 * @class TaskAcceleration 00018 * @brief This TaskAcceleration Class handles the acceleration measurement using the MPU9250. 00019 * Starting the task using the start() starts the measurement. 00020 * It can be used alongside with other measurement Tasks inside the mbed::rtos 00021 * environment. The Task Class basically wraps mbeds Thread functionality. 00022 */ 00023 class TaskAcceleration : public Task { 00024 public: 00025 TaskAcceleration(MPU9250*,Mutex*, Queue<MPU9250AccelerationMessage,ACCELERATION_QUEUE_LENGHT>*); 00026 TaskAcceleration(MPU9250*,Mutex*,Queue<MPU9250AccelerationMessage,ACCELERATION_QUEUE_LENGHT>*, 00027 osPriority, uint32_t, unsigned char*); 00028 virtual ~TaskAcceleration(); 00029 00030 private: 00031 00032 MPU9250* mpu9250; 00033 rtos::Queue<MPU9250AccelerationMessage,ACCELERATION_QUEUE_LENGHT>* queue; 00034 00035 /** 00036 * @brief A thread safe method that measures the acceleration. After measuring the acceleration 00037 * of each axis it stores the value inside a MPU9250AccelerationMessage 00038 */ 00039 void measure(); 00040 00041 /** 00042 * @brief Sets the message Queue of the Task where the measured values will be stored 00043 * after the measurement 00044 * @param queueAcceleration the queue where the MPU9250AccelerationMessage will be stored 00045 */ 00046 void setQueue(Queue<MPU9250AccelerationMessage,ACCELERATION_QUEUE_LENGHT>* queue); 00047 00048 }; 00049 00050 #endif /* TASKACCELERATION_H_ */
Generated on Tue Jul 12 2022 21:35:27 by 1.7.2