首页 > 其他 > 详细

能量得到功率

时间:2020-06-27 20:54:10      阅读:69      评论:0      收藏:0      [点我收藏+]
#include <stdio.h>

//多个变量共同作用才能得到一个值  最终才能得到我们想要效果   
typedef struct _device_power
{
    float voltage;
    float current;
    float direction;
    float power;
}Device_power;

static Device_power component; 

int main(void) {
    
    float power = component.power;
    
    while(1)
    {
        //通过万用表 电压档 得到电压 
        //通过万用表 电流档 得到电流
        component.voltage = 3.46f;
        component.current = 1.2f;
        power = component.voltage * component.current;
        printf("power is %f\n",power);
        
        usleep(10000);
        
    }
    
        
    return 0;
}

 

能量得到功率

原文:https://www.cnblogs.com/nowroot/p/13199627.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!