Git Product home page Git Product logo

rgpower's Introduction

RgPower

简介

RgPower 软件包提供了使用rtthread adc驱动采集电压,使用电池电压计算当前电量百分比,并且借助滤波算法对电量数据进行滤波处理,同时支持低电量自动关机

支持情况

读取方式 支持情况
轮询
中断 ×

软件包依赖

  • 1、RT-Thread Settings 中打开 使用ADC设备驱动程序
  • 2、board.h 中使能任意ADC设备
  • 3、cubemx setting 中选择打开ADC引脚

使用说明

获取软件包

RT-Thread online packages
    peripheral libraries and drivers --->
        [*] Use RgPower --->

示例

#include <rtthread.h>

#define DBG_TAG "main"
#define DBG_LVL DBG_LOG
#include <rtdbg.h>

#include "RgPower.h"

int main(void)
{

    while (1)
    {
        int power = RgPower_get_power();

        if (power < 0)
        {
            LOG_D("充电中");
        }
        else
        {
            LOG_D("电量: %d %%", power);
        }

        rt_thread_mdelay(1000);
    }

    return RT_EOK;
}

注意事项

本软件包依赖RTT ADC驱动,暂时不支持其他平台

联系人信息

rgpower's People

Contributors

1300650671 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.