资源简介
MWC2.4飞控源码 功能更多,更稳定,增加了自动降落功能
代码片段和文件信息
#include “Arduino.h“
#include “config.h“
#include “def.h“
#include “types.h“
#include “MultiWii.h“
#include “LCD.h“
#include “Sensors.h“
#include “Alarms.h“
void alarmPatternComposer();
void patternDecode(uint8_t resourceuint16_t firstuint16_t seconduint16_t thirduint16_t cyclepause uint16_t endpause);
void setTiming(uint8_t resource uint16_t pulse uint16_t pause);
void turnOff(uint8_t resource);
void toggleResource(uint8_t resource uint8_t activate);
void vario_output(uint16_t d uint8_t up);
void inline switch_led_flasher(uint8_t on);
void inline switch_landing_lights(uint8_t on);
void PilotLampSequence(uint16_t speed uint16_t pattern uint8_t num_patterns);
static uint8_t cycleDone[5]={00000}
resourceIsOn[5] = {00000};
static uint32_t LastToggleTime[5] ={00000};
static int16_t i2c_errors_count_old = 0;
static uint8_t SequenceActive[5]={00000};
#if defined(BUZZER)
uint8_t isBuzzerON(void) { return resourceIsOn[1]; } // returns true while buzzer is buzzing; returns 0 for silent periods
#else
uint8_t isBuzzerON() { return 0; }
#endif //end of buzzer define
/********************************************************************/
/**** Alarm Handling ****/
/********************************************************************/
/*
AlarmArray
0: toggle
1: failsafe
2: noGPS
3: beeperOn
4: pMeter
5: runtime
6: vBat
7: confirmation
8: Acc
9: I2C Error
*/
/*
Resources:
0: onboard LED
1: Buzzer
2: PL GREEN
3: PL BLUE
4: PL RED
*/
void alarmHandler(void){
#if defined(RCOPTIONSBEEP)
static uint8_t i = 0firstrun = 1 last_rcOptions[CHECKBOXITEMS];
if (last_rcOptions[i] != rcOptions[i]) alarmArray[ALRM_FAC_TOGGLE] = ALRM_LVL_TOGGLE_1;
last_rcOptions[i] = rcOptions[i];
i++;
if(i >= CHECKBOXITEMS)i=0;
if(firstrun == 1 && alarmArray[ALRM_FAC_CONFIRM] == ALRM_LVL_OFF) {
alarmArray[ALRM_FAC_TOGGLE] = ALRM_LVL_OFF; //only enable options beep AFTER gyro init
alarmArray[ALRM_FAC_BEEPERON] = ALRM_LVL_OFF;
}
else firstrun = 0;
#endif
#if defined(FAILSAFE)
if ( failsafeCnt > (5*FAILSAFE_DELAY) && f.ARMED) {
alarmArray[ALRM_FAC_FAILSAFE] = ALRM_LVL_FAILSAFE_PANIC; //set failsafe warning level to 1 while landing
if (failsafeCnt > 5*(FAILSAFE_DELAY+FAILSAFE_OFF_DELAY)) alarmArray[ALRM_FAC_FAILSAFE] = ALRM_LVL_FAILSAFE_FINDME; //start “find me“ signal after landing
}
if ( failsafeCnt > (5*FAILSAFE_DELAY) && !f.ARMED) alarmArray[ALRM_FAC_FAILSAFE] = ALRM_LVL_FAILSAFE_FINDME; // tx turned off while motors are off: start “find me“ signal
if ( failsafeCnt == 0) alarmArray[ALRM_FAC_FAILSAFE] = ALRM_LVL_OFF; // turn off alarm if TX is okay
#endif
#if GPS
if ((f.GPS_mode != GPS_MODE_NONE) && !f.GPS_FIX) alarmArray[
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 25690 2014-11-20 23:17 MultiWii\Alarms.cpp
文件 1930 2015-01-10 20:52 MultiWii\Alarms.h
文件 70946 2015-03-15 01:18 MultiWii\config.h
文件 7080 2015-03-14 15:45 MultiWii\CREDITS.txt
文件 78497 2015-03-14 15:45 MultiWii\def.h
文件 11828 2014-11-20 23:17 MultiWii\EEPROM.cpp
文件 896 2014-10-05 23:44 MultiWii\EEPROM.h
文件 58994 2014-12-29 01:34 MultiWii\GPS.cpp
文件 917 2014-10-15 18:27 MultiWii\GPS.h
文件 11999 2014-11-04 00:00 MultiWii\IMU.cpp
文件 184 2014-01-19 22:45 MultiWii\IMU.h
文件 106422 2015-03-14 15:45 MultiWii\LCD.cpp
文件 1002 2014-09-15 22:58 MultiWii\LCD.h
文件 55159 2015-03-14 15:52 MultiWii\MultiWii.cpp
文件 8505 2015-03-14 15:52 MultiWii\MultiWii.h
文件 619 2014-01-19 22:45 MultiWii\MultiWii.ino
文件 66989 2014-11-20 23:17 MultiWii\Output.cpp
文件 176 2014-01-19 22:45 MultiWii\Output.h
文件 28804 2015-01-31 17:27 MultiWii\Protocol.cpp
文件 129 2014-01-19 22:45 MultiWii\Protocol.h
文件 35588 2014-11-04 00:40 MultiWii\RX.cpp
文件 315 2014-11-04 00:34 MultiWii\RX.h
文件 61314 2014-11-20 23:54 MultiWii\Sensors.cpp
文件 1956 2014-11-05 00:30 MultiWii\Sensors.h
文件 8279 2014-11-04 00:32 MultiWii\Serial.cpp
文件 762 2014-11-04 23:45 MultiWii\Serial.h
文件 8888 2015-01-20 00:20 MultiWii\types.h
目录 0 2015-03-15 19:54 MultiWiiConf\application.linux32\
目录 0 2015-03-15 19:54 MultiWiiConf\application.linux32\lib\
文件 311280 2012-06-03 22:23 MultiWiiConf\application.linux32\lib\controlP5.jar
文件 221865 2012-12-23 12:35 MultiWiiConf\application.linux32\lib\controlP5_ori.jar
............此处省略107个文件信息
- 上一篇:医院导视系统
- 下一篇:数字设计原理与实践 第四版 英文版
评论
共有 条评论