Table of Contents:
The IM01 is a bridge (or interface) to connect your BBC micro:bit to XinaBox xChips. Your micro:bit slides smoothly into the IM01 and xChips can be easily added using xBus connectors.
But the IM01 is MUCH more than just a bridge:
- Read / write data to the onboard microSD card
- Control the LED
- Plug your USB cable into it to provide power to your micro:bit circuits
1: reading / writing data
A microSD card can be added to the IM01; there is a slot for it on the back.
Use it for data logging - write programs in MakeCode to capture data. LOTS of data.
- With support for up to 32Gigabytes you can save BIG data directly from your micro:bit.
- Add other sensors or record data from the micro:bit onboard sensors
- Great for environmental monitoring over long periods.
- Use in remote locations or on weather balloons / drones.
- Does not lose pairing and is not tethered to a computer or smart device. More flexible and reliable than the alternative options for data logging on a micro:bit.
- The chart below shows temperature and pressure data collected over 24 hours in a home office. There are 65,000 data records, and the data was collected using a micro:bit and the IM01 (we used the SW01 weather sensor for the temperature and pressure readings):
The microSD card can also store resources that you can use in your programs.
- Use config files to tailor the way your program works.
- Save and retrieve game progress.
- Store graphics to use in your displays. e.g. with a 64x64 pixel display you can show QR codes.
- Store long strings on the memory card to save the micro:bit's limited RAM.
- Using the microSD card and the OD01 64x128 pixel OLED display it is possible to use on-screen graphics in your programs, such as those shown in the image below:
You can even build an eReader, like @PlusPlusInt has done. Why not scroll the complete works of Shakespeare on the micro:bit LEDs?
2: control the LED
- The IM01 has an LED mounted on it which you can control from Makecode.
- It shines or blinks in blue or green, or different shades in-between.
- Use it to provide information / feedback about what is happening while your programs runs.
3: powering your instruments
- The micro:bit can supply up to 120mA of power and 3.3V on its output pins.
- When powered directly, the IM01 is able to provide up to five times as much power to the circuit, which means that performance will not degrade with larger circuits and peripherals that require 5V to run properly will be performant: power-hungry peripherals (e.g. 3rd party servos, motors and range finders, Wi-Fi and gesture sensors) that will not work properly when the micro:bit is powered directly will work very well if you provide power via the IM01.
Plug your USB cable into the IM01 to power your micro:bit and ensure that all of your peripherals perform to the best of their abilities.
To write code to interact with the LED on the IM01 in MakeCode you will need to load the IM01 extension:
- Open MakeCode and start a new project
- Click on Extensions
- Type in XinaBox/pxt-im01
- Click on search
- Select the IM01 tile
You can turn the LED on and make it shine blue, green or a mix of both. You can also make it 'wink', which means it turns on briefly then turns off. The simplest way to use it is to just turn on the LED:
Remember to attach your IM01 to your micro:bit before running the code.
Writing data to a file is almost as simple:
- Find a microSD card and format it to FAT32
- Insert it into the slot on your IM01
- Flash the code below onto your micro:bit:
Now do the following:.
- If this is the first time you have used the microSD card with your micro:bit: power up the micro:bit, wait for 10 seconds, then power it down. The micro:bit will set up the microSD card for future use (e.g. a folder called "im01" is added)
- Power up the micro:bit. Wait a short while (10-15 seconds)
- Power down the micro:bit, take out the microSD memory card and plug that into your computer.
- Inside the im01 folder is a file called log.txt. Open that file and see the words "Hello World!" written there.
- Connecting it up
- Loading the extension and Hello World!
- Using the turn on LED functions
- Using the wink functions to make the LED turn on once briefly
Tip: It is fun to play around with the LED but it is also very useful in applications as a way of signalling information to the user. Winking the green light on and off 3 times might indicate an action has been successful whilst holding the blue light on steady for a second could be used to indicate lack of success. Or vary the intensity to pulse the LED at key points. A lot of data can be communicated like this.