Arduino爱好万用表项目(存在于入门套件中)使用float来根据从TMP36读取的电压计算温度。 该Arduino Uno微控制器(ATmega328P)没有任何FPU和计算不具有良好的性能。 我们该如何改进这种计算? // Code for 5V at the input of the TMP36
int reading = analogRead(PIN);
float voltage
我试图读取和写入Raspberry Pi 3的Sensirion SGP30传感器的i2c消息,但我很难将头绕在smbus lib上。 SGP30文档(https://cdn.sos.sk/productdata/46/c9/ba351164/sgp30.pdf)的表,其中显示hexdecimals至Init,并开始测量: 这里是我如何设法得到它运行起来: bus = smbus.SMBus(1)