• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ sendDataHead函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: sendAmperage

static void sendAmperage(void)
{
    amperageMeter_t *state = getAmperageMeter(batteryConfig()->amperageMeterSource);

    sendDataHead(ID_CURRENT);
    serialize16((uint16_t)(state->amperage / 10));
}
开发者ID:Echelon9,项目名称:cleanflight,代码行数:7,代码来源:frsky.c


示例17: sendVoltage

/*
 * Send voltage via ID_VOLT
 *
 * NOTE: This sends voltage divided by batteryCellCount. To get the real
 * battery voltage, you need to multiply the value by batteryCellCount.
 */
static void sendVoltage(void)
{
    static uint16_t currentCell = 0;
    uint32_t cellVoltage;
    uint16_t payload;

    /*
     * Format for Voltage Data for single cells is like this:
     *
     *  llll llll cccc hhhh
     *  l: Low voltage bits
     *  h: High voltage bits
     *  c: Cell number (starting at 0)
     *
     * The actual value sent for cell voltage has resolution of 0.002 volts
     * Since vbat has resolution of 0.1 volts it has to be multiplied by 50
     */
    cellVoltage = ((uint32_t)vbat * 100 + batteryCellCount) / (batteryCellCount * 2);

    // Cell number is at bit 9-12
    payload = (currentCell << 4);

    // Lower voltage bits are at bit 0-8
    payload |= ((cellVoltage & 0x0ff) << 8);

    // Higher voltage bits are at bits 13-15
    payload |= ((cellVoltage & 0xf00) >> 8);

    sendDataHead(ID_VOLT);
    serialize16(payload);

    currentCell++;
    currentCell %= batteryCellCount;
}
开发者ID:qwedsazxc78,项目名称:betaflight_IST8310,代码行数:40,代码来源:frsky.c


示例18: send_Distance

 // Temperature 2
 void inline send_Distance(void)
 {
    if (f.GPS_FIX_HOME)
    {
    sendDataHead(ID_Temperature2);
    write_FrSky16(GPS_distanceToHome); // Distance to home alias Temp2
    }
 }
开发者ID:stpchikari,项目名称:multiwii2_3_frskytele,代码行数:9,代码来源:Telemetry.cpp


示例19: sendVoltageAmp

/*
 * Send voltage with ID_VOLTAGE_AMP
 */
static void sendVoltageAmp(void)
{
    if (telemetryConfig->frsky_vfas_precision == FRSKY_VFAS_PRECISION_HIGH) {
        /*
         * Use new ID 0x39 to send voltage directly in 0.1 volts resolution
         */
        sendDataHead(ID_VOLTAGE_AMP);
        serialize16(vbat);
    } else {
        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:phobos-,项目名称:cleanflight,代码行数:20,代码来源:frsky.c


示例20: send_Voltage_ampere

   // Voltage (Ampere Sensor)
   void inline send_Voltage_ampere(void)
   {
#if defined(VBAT)
      uint16_t Data_Voltage_vBat_bp;
      uint16_t Data_Voltage_vBat_ap;

     uint16_t volts = analog.vbat * TELEMETRY_FRSKY_VBAT / 21;
     Data_Voltage_vBat_bp = volts / 100;
     Data_Voltage_vBat_ap = (volts % 100) / 10;

      sendDataHead(ID_Voltage_Amp_bp);
      write_FrSky16(Data_Voltage_vBat_bp);
      sendDataHead(ID_Voltage_Amp_ap);
      write_FrSky16(Data_Voltage_vBat_ap);


#endif
   }
开发者ID:stpchikari,项目名称:multiwii2_3_frskytele,代码行数:19,代码来源:Telemetry.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sendError函数代码示例发布时间:2022-05-30
下一篇:
C++ sendData函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap