Micro:bit IoT In C
暫譯: Micro:bit 物聯網應用程式開發(C 語言)

Harry Fairhead

  • 出版商: I/O Press
  • 出版日期: 2016-08-15
  • 售價: $1,180
  • 貴賓價: 9.5$1,121
  • 語言: 英文
  • 頁數: 194
  • 裝訂: Paperback
  • ISBN: 1871962455
  • ISBN-13: 9781871962451
  • 相關分類: Micro:bit物聯網 IoT
  • 海外代購書籍(需單獨結帳)

買這商品的人也買了...

相關主題

商品描述

The BBC micro:bit is capable of taking on a variety of roles including that of a powerful IoT device. In order to gain full access to its features and to external devices, however, you need to use C which delivers the speed crucial to programs that communicate with the outside world.

Written for the electronics enthusiast, micro:bit IoT In C starts with a first “Hello Blinky” C program with the mbed online compiler, we move to the desktop to using an offline approach using the yotta development environment plus NetBeans to make things even easier. Now we are ready to discover how to control the micro:bit’s I/O lines, exploring the basis of using the GPIO. For speed, however, we need to work directly with the raw hardware and also master memory mapping, pulse width modulation and other more sophisticated bus types.

From here we can start connecting sensors using first the I2C bus, then by implementing a custom protocol for a one-wire bus, and eventually adding eight channels of 12-bit AtoD with the SPI bus, which involves overcoming some subtle difficulties. We then look at serial connections, one of the oldest ways of connecting devices but still very useful. The micro: bit lacks WiFi connectivity but using a low-cost device we enable a connection to the Internet via its serial port which allows it to become a server.

To conclude we look at the micro:bit’s LED display. This may only be 5x5, but it is very versatile, especially when you use pulse width modulation to vary the brightness level, something we demonstrate in a classic game, written of course in C.

商品描述(中文翻譯)

BBC micro:bit 能夠擔任多種角色,包括作為一個強大的物聯網 (IoT) 裝置。然而,為了充分利用其功能以及與外部裝置的連接,您需要使用 C 語言,因為它提供了與外界溝通的程式所需的速度。

本書《micro:bit IoT In C》是為電子愛好者撰寫的,首先介紹一個使用 mbed 在線編譯器的「Hello Blinky」C 程式,接著轉向桌面環境,使用 yotta 開發環境和 NetBeans 的離線方法,使事情變得更加簡單。現在我們準備探索如何控制 micro:bit 的 I/O 線,並了解使用 GPIO 的基本原理。然而,為了獲得速度,我們需要直接與原始硬體進行操作,並掌握記憶體映射、脈衝寬度調變 (PWM) 以及其他更複雜的匯流排類型。

接下來,我們可以開始連接感測器,首先使用 I2C 匯流排,然後實現一個自定義的一線匯流排協議,最終添加八個通道的 12 位元 AtoD 轉換器,使用 SPI 匯流排,這涉及克服一些微妙的困難。我們接著探討串列連接,這是連接裝置的最古老方式之一,但仍然非常有用。micro:bit 雖然缺乏 WiFi 連接,但通過使用一個低成本的裝置,我們可以通過其串列埠連接到互聯網,使其成為一個伺服器。

最後,我們來看看 micro:bit 的 LED 顯示器。雖然它只有 5x5 的大小,但它非常多功能,特別是當您使用脈衝寬度調變來改變亮度時,這在一個經典遊戲中得到了展示,當然這個遊戲是用 C 語言編寫的。