Skip to Content
Node.js物聯網裝置開發
book

Node.js物聯網裝置開發

by Patrick Mulder, Kelsey Breseman
August 2017
Intermediate to advanced
272 pages
5h 32m
Chinese
GoTop Information, Inc.
Content preview from Node.js物聯網裝置開發
36
|
第二章 Arduino 閃爍燈光
或者,若想
寫出
資料到別台裝置,則要把腳位設為
輸出
模式:
board.pinMode(12, board.MODES.OUTPUT);
切換數位腳位的狀態、切換為 HIGH 高電壓,寫法如下:
board.digitalWrite(13, board.HIGH);
若要輸出低電壓,則這麼寫:
board.digitalWrite(13, board.LOW);
除了簡單的輸出入功能,Arduino 腳位通常還提供了其他功能,意思是說,你不僅能
夠讀取(或寫入)數位狀態,也能啟動特殊形式的傳輸訊號,例如 PWM 和硬體傳輸
協定。
當晶片上不同的部分都使用相同的腳位時,我們稱之為「多工(multiplexing)」腳位功
能。由微控制器晶片架構定義其運作細節。接下來,讓我們深入微控制器晶片的各個功
能區塊,首先是它的 CPU
微控制器 vs 微處理器
微控制器提供腳位,讓我們連接到其他電子零件、組成電路,在那之上,微控制器還能
藉由 CPU 來執行程式。微控制器的規格書,應含有所有細節資訊,底下列出其中最為
重要的規格:
記憶體容量(揮發性、非揮發性),儲存變數與程式碼
指令集種類,執行程式碼、存取變數、各種操作動作
計時器,以高時序準確度改變腳位狀態
耗電功率,視運作時脈頻率而定
與較大台的電腦的 CPU 相比,上述規格讓微控制器適合用於嵌入式系統、適合用於只
有電池供電的情境。更甚者,微控制器的價格,遠遠低於微處理器(不過,微處理器因
為需求量極大,所以也越來越便宜) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

金融人工智能:用Python实现AI量化交易

金融人工智能:用Python实现AI量化交易

Yves Hilpisch
快学熟用D3

快学熟用D3

Philipp K. Janert

Publisher Resources

ISBN: 9789864764594