标签:javascript espruino arduino stm32 开源硬件
http://blog.csdn.net/qwert1213131/article/details/27985645
本文属于个人理解,能力有限,纰漏在所难免,还望指正!
【小鱼有点电】
function BatteryRead(){ var voltage = analogRead(C4);<span style="white-space:pre"> </span>//读取C4引脚的电压 voltage = voltage * 3.3 * 2;<span style="white-space:pre"> </span>//转化为现实中的电压值 console.log(voltage);<span style="white-space:pre"> </span>//串口输出电压值 } setInterval(BatteryRead,1000);<span style="white-space:pre"> </span>//1s间隔输出电压值
【Espruino】NO.07 获取电压值,布布扣,bubuko.com
标签:javascript espruino arduino stm32 开源硬件
原文地址:http://blog.csdn.net/qwert1213131/article/details/27985645