Book Image

Internet of Things Programming with JavaScript

Book Image

Internet of Things Programming with JavaScript

Overview of this book

The Internet of Things is taking the tech world by storm, and JavaScript is at its helm. This book will get you to grips with this exciting new technology. Where do Node.js, HTML5 and Windows 10 IoT Core come in with JavaScript and IoT? Why Raspberry Pi Zero rather than Arduino? How do you configure and build an IoT network from scratch? All your IoT JavaScript questions are answered in this book.
Table of Contents (15 chapters)
Internet of Things Programming with JavaScript
Credits
About the Author
www.packtpub.com
Customer Feedback
Preface

Controlling outputs with Raspberry Pi via Bluetooth


Things go a different route as soon as you’re trying to communicate with other electronic gadgets that uses Bluetooth modules connected to the serial port of the Raspberry Pi.

These modules are very cheap to buy, the actual module is the green board that sits on the breakout board in my model. The pure HC-05 will only work on 3.3V levels, not with 5V-TTL-levels. So one would need level shifters (again).

In this section, we will communicate the Raspberry Pi Zero to the Bluetooth module, and connect the pins TX and RX of the Raspberry Pi.

First, we need to configure the file of the system to make some changes in order to activate the communication of the Raspberry Pi Zero TX and RX:

Controlling lights from an Android Application

We need to download the Bluetooth Terminal, as shown in the following screenshot:

The following screenshot shows the results of sending the numbers 1, 2, 3, 4, 5, and 6:

The following image shows the final part of the project...