Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: RTOS-Setup/inc/setup.h
- Revision:
- 22:ef8aa9728013
- Parent:
- 21:b642c18eccd1
- Child:
- 27:18b6580eb0b1
--- a/RTOS-Setup/inc/setup.h Thu May 08 09:39:12 2014 +0000 +++ b/RTOS-Setup/inc/setup.h Thu May 08 10:33:43 2014 +0000 @@ -1,3 +1,9 @@ +/* File: setup.h + * Author: Trung Tin Ian HUA + * Date: May 2014 + * Purpose: Setup code to initialise all devices. + */ + #include "mbed.h" #include "MPU6050_6Axis_MotionApps20.h" #include "PID.h" @@ -10,46 +16,44 @@ #ifndef _SETUP_H_ #define _SETUP_H_ +/* PID Gains: */ +extern float KP_PITCH_STABLE; +extern float KP_ROLL_STABLE; extern float KP_YAW_RATE; extern float KP_PITCH_RATE; extern float KP_ROLL_RATE; - extern float PID_TI_RATE; extern float PID_TI_STABLE; #define ESC_FREQUENCY 200 #define ESC_PERIOD_US 1000000/ESC_FREQUENCY +/* Sensors and devices: */ extern Serial BT; extern DigitalOut BT_CMD; - extern MPU6050 imu; extern uint16_t packetSize; - -#ifdef ENABLE_COMPASS -extern HMC5883L compass; -#endif +extern MPL3115A2 altimeter; +extern PwmOut ESC[4]; -extern MPL3115A2 altimeter; - -//extern DigitalOut LED[]; - +/* PID Devices: */ extern PID pitchPIDstable; extern PID rollPIDstable; extern PID yawPIDrate; extern PID pitchPIDrate; extern PID rollPIDrate; -extern PwmOut ESC[4]; - +/* Setup routines: */ bool setupALLdevices(void); bool setup_ESC(void); bool setup_bt(void); bool setup_PID(void); bool setup_mpu6050(void); +bool setup_altimeter(void); + #ifdef ENABLE_COMPASS +extern HMC5883L compass; bool setup_compass(void); #endif -bool setup_altimeter(void); #endif