About micro:bit Module¶
This document will help you to understand the micro:bit module integration with some elements of HARDWARIO IoT Kit and extension that we made for it.
Before we start to explore the extension itself, we will introduce the modules and tags that are supported by it:
Mini Battery Module
Lux Meter Tag
You can get all of these in our shop separately or there are some bundles available if you want to buy more of them at once.
You can watch the video for more explaining about each thing on the list. I go over all of them one by one.
Setting up the environment¶
After you have your micro:bit, our micro:bit module and some sensor to plug into it, you can start using our extension to connect it all on the programming part. You will need some micro-USB cable to connect the device to your PC.
Next I recommend downloading a Google Chrome browser, I will get to why it is the best one to go with in the next few lines.
Go to micro:bit makecode page, click a New Project button and give your project some good name.
You will be able to get back to your projects on this page so it will be a lot easier if you keep it organized.
You will be redirected into the makecode environment, where you can start your coding.
To get HARDWARIO extension, you just need to click Advanced on the left side of the editor and then all the way down, click on Extensions and you should see a screen that looks something like this one.
Type HARDWARIO into the search box and you should see just one extension and that will be the one you are looking for, just click on it and you will see a new selection available on the left side where all the blocks are located.
After all this is done you are ready to explore the extension block by block.
I will again talk about all that is in this chapter in the video below.
Exploring the extension¶
If you never worked with the micro:bit makecode editor I will try and explain as much as I can in the paragraphs below but I recommend you to watch this chapter’s video.
On the start of each project you will see this screen that has Two blocks: on start and forever.
This is the first type of block that we also have in the extension. You can put more blocks into those and they will run each time that the event occurs. The on start block and all blocks in it will fire as you can guess by the name on the start of the code, that is if you restart the micro:bit by giving it power or by the hardware button on the bottom of it.
The forever block just executes over and over again.
Now that we know the basics about the makecode for micro:bit we can talk about blocks that are actually in our developed extension.
You can see the blocks ordered in categories for easier orientation. I will explain the category followed by a short example.
Uploading your code to micro:bit¶
Thanks to a great micro:bit environment and the Google Chrome browser that you downloaded in the first steps.
After you completed your code, you can just one click download it to your device.
Connect the micro:bit with usb into the computer.
Pair the device
After you click the Pair device, there should be one device that you should select.
If you did everything right the icon on the Download button should change.
If you now click Download you it will automatically be downloaded to your connected micro:bit.
Also you will be able to access the console of the actual device, not just the simulator. You can get some nice stuff in there, like charts, serial output, pin states, etc.
In this chapter you will learn about some use cases that you can try and do with micro:bit and HARDWARIO TOWER - Industrial IoT Kit. You can try and make them by yourself or, if you are stuck, you can look at the solution here. There will be some challenges on the way.
This code should simulate some basic thermostat that can control the heating in your house. Of course you don’t have to actually connect your heating to it. Just visualize it with the icons on the LED matrix or some sound.
Try and make it adjustable so you can change the border temperature.
Next level can be maybe to use it with some actual heating device with a use of a relay.
You can make similar projects with different tags for example: Automatic lights, Mold fighter.
You can use our LED Strips with the micro:bit module, and micro:bit. You will use the standart connector located on the Power Module and neopixel extension.
Download the neopixel extension just as you downloaded the HARDWARIO extension and you are ready to work with the LEDs.
Exploring the extension¶
You can use all of those blocks with our LED strip, there are a lot of possibilities.
Only thing you need to do is to set up the strip to the PIN P1 and number of LEDs based on the strip, aslo set the type to RGB+W.
With this done you can use all the other blocks from extension and start experimenting with all the colors and effects.
There is a tutorial that you can visit so you can get the image on what you can do with the strip.