找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 6195|回復: 1
收起左側

msp430g2553內建溫度計使用Arduino代碼

[復制鏈接]
ID:348619 發(fā)表于 2018-6-10 10:22 | 顯示全部樓層 |閱讀模式
msp430g2553 內建溫度計 使用代碼
0.png

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)



評分

參與人數 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎勵!

查看全部評分

回復

使用道具 舉報

ID:584195 發(fā)表于 2021-8-17 09:33 | 顯示全部樓層
高手在民間呀!
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表