看板 Electronics 關於我們 聯絡資訊
我手上有一個溫度感測器MAX6675模組 然後我去下載這個library來用 http://0rz.tw/C1Z1k 在 MAX6675.cpp 這個檔案裡 有一段是這樣寫 /* Read bits 14-3 from MAX6675 for the Temp. Loop for each bit reading the value and storing the final value in 'temp' */ for (int i=11; i>=0; i--) { digitalWrite(_SCK_pin,HIGH); value += digitalRead(_SO_pin) << i; digitalWrite(_SCK_pin,LOW); } 它說這段是讀取第14個~第3個bit 那為什麼 i 的值是從11~0,為什麼不是從14~3? 有點想不通 thx -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.35.225.106 ※ 文章網址: https://www.ptt.cc/bbs/Electronics/M.1433503975.A.D3B.html ken1325:轉錄至看板 ASM 06/05 19:33
yudofu: 它是直接擠左邊高位11個bit出來? 06/05 20:21
tracetw: 最低只能到3 06/05 20:36
ken1325: 懂了 感謝 06/05 22:23