• Complain

Harry Fairhead - micro:bit IoT In C, 2nd Edition

Here you can read online Harry Fairhead - micro:bit IoT In C, 2nd Edition full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2021, publisher: I/O Press, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Harry Fairhead micro:bit IoT In C, 2nd Edition
  • Book:
    micro:bit IoT In C, 2nd Edition
  • Author:
  • Publisher:
    I/O Press
  • Genre:
  • Year:
    2021
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

micro:bit IoT In C, 2nd Edition: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "micro:bit IoT In C, 2nd Edition" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

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 which is crucial when you are writing programs to communicate with the outside world.

The new V2 version of the micro:bit is fully covered in Micro:bit IoT in C, Second Edition, which now uses the highly popular VS Code for offline development. It covers how to get started the easy way by providing downloadable templates for both V1 and V2 of the micro:bit.

Having started with the traditional Blinky program, the equivalent of Hello World for hardware, we are ready to discover how to control the micro:bits 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 A-to-D 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. Next we look at the micro:bits 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. The book rounds out with a new chapter on the micro:bits radio and the V2s sound capabilities.

Harry Fairhead has worked with microprocessors, and electronics in general, for many years and is an enthusiastic proponent of the IoT. He is the author of Raspberry Pi IoT in C, which has recently been republished in its second edition, updated for Raspberry Pi 4, and of Raspberry Pi IoT In C With Linux Drivers. He has also co-authored Python versions of these books - Raspberry Pi IoT in Python Using GPIO Zero and Raspberry Pi IoT In Python With Linux Drivers. His own language of choice is C and he has also written Fundamental C: Getting Closer To The Machine and Applying C For The IoT With Linux.

Harry Fairhead: author's other books


Who wrote micro:bit IoT In C, 2nd Edition? Find out the surname, the name of the author of the book and a list of all author's works by series.

micro:bit IoT In C, 2nd Edition — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "micro:bit IoT In C, 2nd Edition" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make

Micro:bit IoT In CSecond EditionHarry FairheadI/O PressI Programmer Library Copyright 2021 IO Press All rights reserved. This book or any portion thereof may not be reproduced or used in any manner whatsoever without the express written permission of the publisher except for the use of brief quotations in a book review. Harry Fairhead, Micro:bit IoT In C ISBN Paperback: 9781871962673 Second Edition First Printing, February 2021 Revision 0 Published by IO Press www.iopress.info In association with I Programmer www.i-programmer.info and with I o T Programmer www.iot-programmer.com The publisher recognizes and respects all marks used by companies and manufacturers as a means to distinguish their products. All brand names and product names mentioned in this book are trade marks or service marks of their respective companies and our omission of trade marks is not an attempt to infringe on the property of others. In particular we acknowledge that "BBC and micro:bit are trade marks of the BBC. Preface The BBC micro:bit is a remarkable device capable of taking on a variety of roles.

When it was originally launched in 2015 it was the preserve of school children, with one million given away free via secondary schools in the UK and the emphasis was on introducing this audience to programming and digital technology. By the time the first edition of this book was written it had gone on public sale and the fact that it is an ideal vehicle for IoT could come to the fore. Writing this new edition was prompted by the advent of the micro:bit V2, an enhanced version based on a different, more powerful microprocessor. Whereas the original version is an mbed device, the V2 has broken free, giving it new capabilities but also presenting problems by not being fully backward compatible with its predecessor. Tempting as it might be to disregard the earlier version, the fact that there are so many of them, more than four million, out in the wild and that many people already have invested time and effort in working projects, rules out this option, so this book caters for both versions and points out the differences between that might trip up the unwary developer. This book isnt an introduction to the micro:bit.

For this you are recommended to visit its own website, https://www.microbit.co.uk/ where you will find activities with step-by-step guidance for beginners. Instead this book assumes you have taken you first steps with programming, have an interest in electronics and want to use the micro:bit for Internet of Things projects, that is any situation in which you want to interact with real world objects. While much of the introductory material for the micro:bit uses MicroPython, this book uses C in order to realize its full potential as an IoT device. The main reason for choosing C is speed which is crucial when you are writing programs to communicate with the outside world. Whereas the first edition used NetBeans and Yotta this book uses Visual Studio Code as its development environment. The only problem with this is setting it up and to make this easier there are two templates, one for the V1 and one for the V2 micro:bit available for download from the I Programmer GitHub repository.

You dont need to use these however if you are feeling up to tackling Yotta and Cmake from scratch. How to do this is described in the appendixes at the end of the book. After setting everything up and compiling and running a sample program we move on to a Blinky C program. Now we are ready to discover how to control the micro:bits 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 1-Wire bus, and eventually adding eight channels of 12-bit A-to-D 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. Next we look at the micro:bits 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. Finally we look at how to use the radio and the new sound capabilities of the micro:bit V2 and finish with an example of a two-way Morse code radio link. Thanks as ever to my painstaking editors Sue Gee and Kay Ewbank for their input to this edition.

For updates, errata, links to resources and the source code for the programs in this book visit its dedicated page on the IO Press website: www.iopress.info. Harry Fairhead February, 2021 Table of Contents

Preface
3
Chapter 1
The Micro:bit Family
Meet the Micro:bits...........................................................................11 Why Choose a Micro:bit?..................................................................14 The Software.....................................................................................14 Why C/C++?.....................................................................................16 Summary...........................................................................................18
Chapter 2
Getting Started With C
Prerequisites......................................................................................20 VS Code.............................................................................................21 Hello World For Micro:bit V1............................................................22 Hello World For Micro:bit V2............................................................27 Your First Program - Blinky...............................................................29 Universal Hex....................................................................................30 Summary...........................................................................................31
Chapter 3
First Steps With The GPIO
Pinouts...............................................................................................33 GPIO Capabilities..............................................................................37 Digital GPIO.......................................................................................38 Drive Type..........................................................................................39 GPIO Drive Characteristics...............................................................42 An FET Buffer....................................................................................43 GPIO Output......................................................................................44 Phased Pulses....................................................................................47 GPIO Input.........................................................................................50 A Basic Input Circuit - The Switch..................................................50 The Potential Divider........................................................................51 How Fast Can We Measure?..............................................................52 Interrupts...........................................................................................54 Summary...........................................................................................58 Chapter 4Fast Memory-Mapped GPIO The GPIO Registers...........................................................................59 A Fast Pulse........................................................................................62 Phased Pulses....................................................................................65 How Fast Can Input Be?....................................................................68 Summary...........................................................................................70
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «micro:bit IoT In C, 2nd Edition»

Look at similar books to micro:bit IoT In C, 2nd Edition. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «micro:bit IoT In C, 2nd Edition»

Discussion, reviews of the book micro:bit IoT In C, 2nd Edition and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.