/* @Author: http://tonylabs.taobao.com @Date: 2013.03.13 */ #include void setup() { Serial.begin(9600); //@初始化串口 } void loop() { //@读取 TMP36 温度传感器温度数值,并返回摄氏度 int celsius = Esplora.readTemperature(DEGREES_C); //@读取 TMP36 温度传感器温度数值,并返回华氏度 int fahrenheit = Esplora.readTemperature(DEGREES_F); //@输出结果 Serial.print("Temperature is: "); Serial.print(celsius); Serial.print(" degrees Celsius, or "); Serial.print(fahrenheit); Serial.println(" degrees Fahrenheit."); Serial.println(" Fahrenheit = (9/5 * Celsius) + 32"); //@延时 1 秒 delay(1000); }
0 留言
留言
您的留言将被人工审核,请勿发表色情、反动言论。
您可能感兴趣
Arduino + SHT1X 制作温度、湿度传感系统
通过Arduino和SHT1X传感器,实现实时监测环境温度和湿度的简单而有效的方案。文章提供电路连接和示例代码,...