1年11个月前IP:福建
939587
10楼

#include <DFRobot_HX711_I2C.h>


// 动态变量

volatile float mind_n_m, mind_n_w;


// 创建对象

DFRobot_HX711_I2C MyScale(&Wire, 0x64);



// 主程序开始

void setup() {

Serial.begin(115200);

mind_n_m = 0;

while (!MyScale.begin());

for (int index = 0; index < 200; index++) {

mind_n_w = (MyScale.readWeight());

if ((mind_n_w>mind_n_m)) {

mind_n_m = mind_n_w;

}

Serial.print(mind_n_w);

Serial.print(",");

Serial.println(mind_n_m);

}

}

void loop() {


}

改好的代码

评论(4)
2
文号 / 939587

名片发私信
学术分 0
总主题 4 帖总回复 52 楼拥有证书:开除学籍
注册于 2024/11/19 13:24:27最后登录 2025/06/28 13:29:47
主体类型:个人
所属领域:无
认证方式:手机号
IP归属地:福建

个人简介

暂未填写
笔记
{{note.content}}
{{n.user.username}}
{{fromNow(n.toc)}} {{n.status === noteStatus.disabled ? "已屏蔽" : ""}} {{n.status === noteStatus.unknown ? "正在审核" : ""}} {{n.status === noteStatus.deleted ? '已删除' : ''}}
  • 编辑
  • 删除
  • {{n.status === 'disabled' ? "解除屏蔽" : "屏蔽" }}
我也是有底线的