标题: msp430g2553内建温度计使用Arduino代码 [打印本页]

作者: hello_word    时间: 2018-6-10 10:22
标题: msp430g2553内建温度计使用Arduino代码
msp430g2553 内建温度计 使用代码


Arduino源码:
  1. #include "internaltempsensor.h"

  2. void setup()
  3. {
  4.   Serial.begin(9600);  
  5.   Serial.println("BOOTED");
  6. }

  7. void printDec(int32_t ui)
  8. {
  9.   if(ui < 0)
  10.     Serial.print("-");
  11.    
  12.   Serial.print(ui/10, DEC);
  13.   Serial.print(".");
  14.   Serial.print(ui%10, DEC);
  15. }

  16. void loop()
  17. {
  18.   int32_t currentValue = MSPTemp.update();
  19.   Serial.print("Internal temperature (integer) : ");
  20.   printDec(currentValue);
  21.   Serial.println();
  22.   
  23.   Serial.print("Internal temperature (float)   : ");
  24.   Serial.print(MSPTemp.temperatureFloat());
  25.   Serial.println();  
  26.   
  27.   delay(2000);   
  28. }



复制代码

全部资料51hei下载地址:

msp430intertempsensor-master.zip (4.15 KB, 下载次数: 11)




作者: zyluglugl    时间: 2021-8-17 09:33
高手在民间呀!




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1