当前位置: 首页>>代码示例>>C++>>正文


C++ sendDataHead函数代码示例

本文整理汇总了C++中sendDataHead函数的典型用法代码示例。如果您正苦于以下问题:C++ sendDataHead函数的具体用法?C++ sendDataHead怎么用?C++ sendDataHead使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sendDataHead函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sendBaro

static void sendBaro(void)
{
    sendDataHead(0x10);
    serialize16(EstAlt / 100);
    sendDataHead(0x21);
    serialize16(EstAlt % 100);
}
开发者ID:DuinoPilot,项目名称:TMR,代码行数:7,代码来源:telemetry.c

示例2: sendHeading

static void sendHeading(void)
{
    sendDataHead(ID_COURSE_BP);
    serialize16((int16_t)heading);
    sendDataHead(ID_COURSE_AP);
    serialize16(0);
}
开发者ID:hinkel,项目名称:SGTodaysSnapshot2NoHex,代码行数:7,代码来源:telemetry.c

示例3: sendBaro

static void sendBaro(void)
{
    sendDataHead(ID_ALTITUDE_BP);
    serialize16((int32_t)EstAlt / 100);
    sendDataHead(ID_ALTITUDE_AP);
    serialize16((int32_t)EstAlt % 100);
}
开发者ID:hinkel,项目名称:SGTodaysSnapshot2NoHex,代码行数:7,代码来源:telemetry.c

示例4: sendBaro

static void sendBaro(void)
{
    sendDataHead(ID_ALTITUDE_BP);
    serialize16(BaroAlt / 100);
    sendDataHead(ID_ALTITUDE_AP);
    serialize16(ABS(BaroAlt % 100));
}
开发者ID:qwedsazxc78,项目名称:betaflight_IST8310,代码行数:7,代码来源:frsky.c

示例5: sendHeading

static void sendHeading(void)
{
    sendDataHead(ID_COURSE_BP);
    serialize16(DECIDEGREES_TO_DEGREES(attitude.values.yaw));
    sendDataHead(ID_COURSE_AP);
    serialize16(0);
}
开发者ID:qwedsazxc78,项目名称:betaflight_IST8310,代码行数:7,代码来源:frsky.c

示例6: sendVoltageAmp

/*
 * Send voltage with ID_VOLTAGE_AMP
 */
static void sendVoltageAmp()
{
    uint16_t voltage = (vbat * 110) / 21;

    sendDataHead(ID_VOLTAGE_AMP_BP);
    serialize16(voltage / 100);
    sendDataHead(ID_VOLTAGE_AMP_AP);
    serialize16(((voltage % 100) + 5) / 10);
}
开发者ID:hinkel,项目名称:SGTodaysSnapshot2NoHex,代码行数:12,代码来源:telemetry.c

示例7: sendSpeed

static void sendSpeed(void)
{
    if (!STATE(GPS_FIX)) {
        return;
    }
    //Speed should be sent in m/s (GPS speed is in cm/s)
    sendDataHead(ID_GPS_SPEED_BP);
    serialize16((GPS_speed * 0.01 + 0.5));
    sendDataHead(ID_GPS_SPEED_AP);
    serialize16(0); //Not dipslayed
}
开发者ID:FLYFPV,项目名称:cleanflight,代码行数:11,代码来源:frsky.c

示例8: sendTime

static void sendTime(void)
{
    uint32_t seconds = millis() / 1000;
    uint8_t minutes = (seconds / 60) % 60;

    // if we fly for more than an hour, something's wrong anyway
    sendDataHead(ID_HOUR_MINUTE);
    serialize16(minutes << 8);
    sendDataHead(ID_SECOND);
    serialize16(seconds % 60);
}
开发者ID:qwedsazxc78,项目名称:betaflight_IST8310,代码行数:11,代码来源:frsky.c

示例9: sendGpsAltitude

static void sendGpsAltitude(void)
{
    uint16_t altitude = GPS_altitude;
    //Send real GPS altitude only if it's reliable (there's a GPS fix)
    if (!STATE(GPS_FIX)) {
        altitude = 0;
    }
    sendDataHead(ID_GPS_ALTIDUTE_BP);
    serialize16(altitude);
    sendDataHead(ID_GPS_ALTIDUTE_AP);
    serialize16(0);
}
开发者ID:qwedsazxc78,项目名称:betaflight_IST8310,代码行数:12,代码来源:frsky.c

示例10: sendSpeed

static void sendSpeed(void)
{
    if (!STATE(GPS_FIX)) {
        return;
    }
    //Speed should be sent in knots (GPS speed is in cm/s)
    sendDataHead(ID_GPS_SPEED_BP);
    //convert to knots: 1cm/s = 0.0194384449 knots
    serialize16(GPS_speed * 1944 / 100000);
    sendDataHead(ID_GPS_SPEED_AP);
    serialize16((GPS_speed * 1944 / 100) % 100);
}
开发者ID:qwedsazxc78,项目名称:betaflight_IST8310,代码行数:12,代码来源:frsky.c

示例11: send_Course

   // Course
   void inline send_Course(void)
   {
  uint16_t Datas_Course_bp;
  uint16_t Datas_Course_ap;

  Datas_Course_bp = att.heading ; //att.heading 
  Datas_Course_ap = 0;

  sendDataHead(ID_Course_bp);
  write_FrSky16(Datas_Course_bp);
  sendDataHead(ID_Course_ap);
  write_FrSky16(Datas_Course_ap);
   }
开发者ID:stpchikari,项目名称:multiwii2_3_frskytele,代码行数:14,代码来源:Telemetry.cpp

示例12: sendTwoPart

   static void inline sendTwoPart(uint8_t bpId, uint8_t apId, float value, uint16_t resolution = 100)
   {
         int16_t bpVal;
         uint16_t apVal;

         bpVal = floor(value); // value before the decimal point ("bp" is "before point")
         apVal = (value - int(value)) * resolution; // value after the decimal point

         sendDataHead(bpId);
         write_FrSky16(bpVal);
         sendDataHead(apId);
         write_FrSky16(apVal);
   }
开发者ID:stpchikari,项目名称:multiwii2_3_frskytele,代码行数:13,代码来源:Telemetry.cpp

示例13: send_Accel

   // ACC
   void send_Accel(void)
   {    
  int16_t Datas_Ang_X;
  int16_t Datas_Ang_Y;

  Datas_Ang_X = att.angle[0];
  Datas_Ang_Y = att.angle[1];
  
  sendDataHead(ID_Ang_X);
  write_FrSky16(Datas_Ang_X);
  sendDataHead(ID_Ang_Y);
  write_FrSky16(Datas_Ang_Y);
//Frsky      
   }
开发者ID:stpchikari,项目名称:multiwii2_3_frskytele,代码行数:15,代码来源:Telemetry.cpp

示例14: send_Time

   // Time
   void inline send_Time(void)
   {
      uint16_t seconds_since_start;
      uint16_t Data_Minutes_hours;
      uint16_t Data_seconds;

      if (showTime.TimerStart) {
         seconds_since_start = (millis() - showTime.armingTime) / 1000;
         Data_Minutes_hours = seconds_since_start / 60;
         Data_seconds = seconds_since_start - 60 * Data_Minutes_hours;
         sendDataHead(ID_Hour_Minute);
         write_FrSky16(Data_Minutes_hours * 256);
         sendDataHead(ID_Second);
         write_FrSky16(Data_seconds);
         }
   }
开发者ID:stpchikari,项目名称:multiwii2_3_frskytele,代码行数:17,代码来源:Telemetry.cpp

示例15: sendAccel

static void sendAccel(void)
{
    for (int i = 0; i < 3; i++) {
        sendDataHead(ID_ACC_X + i);
        serialize16(1000 * (int32_t)accSmooth[i] / acc.acc_1G);
    }
}
开发者ID:180jacob,项目名称:cleanflight,代码行数:7,代码来源:frsky.c


注:本文中的sendDataHead函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。