The micro:bit has some sensors built into it, not all MicroPython boards come with sensors built in but many do, and the way that we interface with them is in most cases the same. The first step is to import the required library then use that library to grab the data from the sensor.
We are also going to look at some more python constructs the list and the function. Lists store a collection of variables under the same name and can be indexed conveniently. A function is a block of code we can call at any time.
The great thing about working with built-in sensors and outputs is that we do not need to wire up any circuits to make this work.
Full Guide: https://core-electronics.com.au/tutor...
Core Electronics is located in the heart of Newcastle, Australia. We're powered by makers, for makers. Drop by if you are looking for:
Micro:bit https://core-electronics.com.au/brand...
Micro:bit Go Kit https://core-electronics.com.au/catal...
Micro:bit https://core-electronics.com.au/catal...
Watch video MicroPython for Micro:bit - Onboard Sensors and How to Write Functions online without registration, duration hours minute second in high quality. This video was added by user Core Electronics 09 March 2019, don't forget to share it with your friends and acquaintances, it has been viewed on our site 4,630 once and liked it 50 people.