Guide
3/7/2018 SparkFun Inventor's Kit for micro:bit Experiment Guide - learn.sparkfun.com
https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-for-microbit-experiment-guide/all#introduction-to-microsoft-makecode 41/63
COPY CODE
Note: You may need to disable your ad/pop-up blocker to interact with the MakeCode programming environment and
simulated circuit!
Code to Note
Let’s take a look at the code blocks in this experiment.
If you are having a hard time viewing this code, click on the image above to get a better look!
Adding an External Package
In MakeCode you can write external pieces of code that allows you to create and use custom blocks for specific applications
and/or components that you could use with the micro:bit. We wrote a simple package for the TMP36 temperature sensor to cut out
a lot of complicated math for you to do.
To add a package to your MakeCode editor first click on Advanced and then Add Packages….
This will bring up a search box. Feel free to search for different packages to play with, but for this specific example you need to
search for a specific package. Please copy the link below and paste it into your search box.
https://github.com/sparkfun/pxt-tmp36
This should bring up the TMP36 package that we wrote. To add the package to your sketch just click on the package once it
appears in the search output!