This further help resource contains download links for additional code examples and also a walk-through video that covers the experiment in full. The video also has hints and tips to help you complete the experiment.
Inventors Kit Experiment 3 - Dimming An LED Using A Potentiometer:
This experiment will use a 'variable' to track whether an LED should be turned on or off when a push switch is pressed. A potentiometer will be used to alter the brightness of an LED when it is on. This is achieved by two separate loops of code that run at the same time. One remembers the state of the switch (on or off). The other outputs a signal to the LED based on the voltage it reads from the potentiometer. The higher the voltage from the potentiometer the brighter the LED shines. It does this using pulse width modulation (PWM) and the later experiments go into more detail about how these signals work.Video Walk-Through With Hints & Tips:
Code Downloads:
The code examples below have been individually zipped and can be downloaded by clicking on your preferred option. Once unzipped you can either open the and edit the code in appropriate editor or place the HEX file onto your microbit*.MakeCode Editor & Python Code Downloads:
- This code was created with the MakeCode Editor, download the HEX file here.
- This code was created with the Python Editor, download the HEX file here.
Legacy Editors Code Downloads:
NOTE: The legacy editors will disappear at some undisclosed point in the future. The code can still be placed on a microbit and will run regardless but you won't be able to use an editor. When that happens, switch to using one of the currently supported editors. We've already made the switch as the new editors are better and more fully featured.- This code was created with the Blocks Editor, download the HEX file here.
- This code was created with the Touch Develop Editor, download the HEX file here.
Booklet Errata:
- On page 23 there is a box describing which blocks you need for this experiment.
- We incorrectly listed an IF DO ELSE block. This should be an IF DO block.
- You then need to click the cog icon to change the 'if do' block into an 'if do else' block by dragging the 'else' into the 'if' loop as shown below.
Kitronik Inventors Kit Resources:
Exp No#. | Experiment Name. | Resource Type. |
---|---|---|
1 | Say Hello to the BBC micro:bit. | Further Help. |
2 Pre V1.7 | Using an LDR and analog inputs. | Full Experiment + Further Help. |
2 V1.7 | Using a Light Sensor & analog inputs. | Full Experiment + Further Help. |
3 | Dimming an LED using a potentiometer. | Further Help. |
4 | Using a transistor to drive a motor. | Full Experiment + Further Help. |
5 | Using the accelerometer to control motor speed. | Further Help. |
6 | Setting the tone with a piezo buzzer. | Further Help. |
7 | Wind Power. | Full Experiment + Further Help. |
8 | Making a game using the compass. | Further Help. |
9 | Capacitor charge circuit. | Further Help. |
10 | Using an RGB LED. | Further Help. |
11 | Making a pedestrian crossing. | Full Experiment + Further Help. |
12 | Making a random dice. | Full Experiment + Further Help. |
©Kitronik Ltd – You may print this page & link to it, but must not copy the page or part thereof without Kitronik's prior written consent.
3 comments
Jetro de Château
Do you have a PDF version for the updated booklet? The makecode has changed and some steps are inverted; e.g. in experiment 3 [analog write “analog read pin P1” to pin P2] now is [analog write pin P2 to "analog read pin P1]
Mark Donnison
Hi Tony, we've reproduced the booklet approx half a dozen times since it's release. Not all revisions were down to technical issues or blocks changes, some were typo/English related. The online resources should have all Errata information listed but if you find this not to be the case let me know and I will fix it.
Tony Goodhew
Thanks for the update. I bought the kit when it first came out and only started using it with mu granddaughter 3 weeks ago. My booklet is version 1.1 and these blocks did give us a short pause. When was the update section added?