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物聯網裝置開發
114
|
第八章 與硬體相關的 Node.js 程式庫
USART 的話,則由外部時脈訊號驅動傳輸工作,可得到更快的傳輸速度,並且支援
更多樣的協定。
關於硬體傳輸協定,讀者若有興趣,請參閱 Kevin Sidwar Kelsey Breseman
的部落格文章「A Web Developer
s Guide to Communication Protocols(給
網站開發人員看的傳輸協定指南)」(
https://tessel.io/blog/108840925797/a-web-
developers-guide-tocommunication-protocols
),相當不錯的入門介紹,包含運作
原理以及為什麼你該選用此種傳輸方式。
在主機電腦上,作業系統透過軟體驅動程式連接到 UART,驅動程式負責資料的輸入與
輸出、以及訊號的組態設定(I/O 控制,或是嵌入式語言的
ioctl
)。意思是說,若想要
在筆電上使用 Node.js Arduino 進行傳輸,那麼你所撰寫的 JavaScript 程式碼,實際
上是與作業系統和驅動程式溝通,藉以存取序列埠。
瞭解上述概念之後,我們便可嘗試使用 node-serialport 程式庫。首先,介紹如何在
JavaScript 程式裡掃描裝置,找到你想溝通的裝置後,下一步便可從裝置收取(有時候
也稱為「傾倒,dump」)資料,最後學習如何送出資料給裝置。
掃描裝置
終於要開始使用 serialport 程式庫囉!讓我們先建立全新的 JavaScript ...
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