查看Noduino BMP180的源代码
←
Noduino BMP180
跳转到:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
== 代码示例 == <source lang=cpp> #include "noduino.h" #include "bmp180.h" irom void setup() { serial_begin(115200); if (!bmp180_begin()) { serial_print("Could not find a valid BMP180 sensor,\ check wiring!\r\n"); while (1) {} } } irom void loop() { char obuf[16]; double t = 0, p = 0; bmp180_startTemperature(); delay(15); bmp180_getTemperature(&t); dtostrf(t, 16, 2, obuf); serial_printf("Temperature = \t\t%s C\r\n", obuf); bmp180_startPressure(1); delay(15); bmp180_getPressure(&p, &t); dtostrf(p, 16, 2, obuf); serial_printf("Pressure = \t\t%s mbar\r\n", obuf); dtostrf(bmp180_sealevel(p, 50), 16, 2, obuf); // Calculate altitude assuming 'standard' barometric // pressure of 1013.25 millibar = 101325 Pascal serial_printf("Pressure at sealevel (calculated) = %s mbar\r\n", obuf); // you can get a more precise measurement of altitude // if you know the current sea level pressure which will // vary with weather and such. If it is 1015 millibars // that is equal to 101500 Pascals. dtostrf(bmp180_altitude(p, bmp180_sealevel(p, 50)), 16, 2, obuf); serial_printf("Real altitude = \t%s M\r\n\r\n", obuf); delay(3000); } </source> <br><br>
返回到
Noduino BMP180
。
个人工具
登录
名字空间
页面
讨论
变换
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
社区专页
新闻动态
最近更改
随机页面
帮助
工具箱
链入页面
相关更改
特殊页面