Open this page at https://johnvidler.github.io/pxt-clip-bit/
This repository can be added as an extension in MakeCode.
- open https://makecode.microbit.org/
- click on New Project
- click on Extensions under the gearwheel menu
- search for https://github.com/johnvidler/pxt-clip-bit and import
OR simply click this link and make a copy of the example project to have everything automatically imported for you!
These blocks control the two LEDs at the top of the Clip:bit, as well as the 12 full-colour RGB LEDs along both left and right sides of the board. Each LED has an associated button, so we use the button name to address each LED as well.
Turn on or off one of the Clip:bit LEDs. This only affects the C and D LEDs as they can only be on or off, rather than the RGB ones for the Lx and Rx buttons.
Clears all color data for the pixels, and turns them off
Clear a Clip:bit pixel. This effectively turns the LED off.
Sets the brightness of any pixels set after this point.
Sets the pixel colour for each button on the Clip:Bit. Note that while C and D are listed, the only colours those support are 'Red' and 'Black' which map to 'on' and 'off' respectively.
Used to select a single button reference from the drop-down list for any of the button or pixel command blocks
The enclosed code here will be run whenever any button is pressed, and the of the button (if set) will also be supplied.
Run the enclosed code when the selected Clip:bit button is pressed down
Run the enclosed code when the selected Clip:bit button is released
Returns TRUE if the selected button currently being pressed down?
Set the selected 7-segment display to show a (limited) set of characters.
The limitations of the 8 LEDs on a 7-segment display mean that some characters are rendered slightly strangely, but most normal ASCII characters are possible to some degree.
Note that the display modules are only capable of showing two characters, and will not scroll longer messages.
Clear the selected 7-segment display This will turn the display off
Render a number on one of the Clip:bit 7-segment displays This supports either DECIMAL or HEXADECIMAL modes
The following blocks are included to allow more advanced interaction with the clip:bit, and can be found bit pressing the ... more
button in the Makecode interface when the Clip:bit extension is selected
This variable returns the internal reference to the NeoPixel strip on the Clip:Bit, so it can be used with the NeoPixel extension.
Since we last checked (when we last used this function for this button), has the button been pressed?
Returns the button name (if set) for the supplied button
Set the button name for the selected button. This will be returned in the general button handler, and in calls to 'getButtonName'.
Checks to see if a display module is actively displaying anything.
Get the currently displayed value from the selected 7-segment display.
Technical details of the board can be found here: https://johnvidler.co.uk/blog/the-clipbit-an-addon-for-the-microbit/
The Clip:bit has been used in the following academic publications:
Lorraine Underwood, Elizabeth Edwards, John Edward Vidler, Elisa Rubegni, and Joe Finney. 2023. Introducing Classroom Cloudlet: a mobile, tangible, and transparent approach to Internet of Things education. In Proceedings of the 22nd Annual ACM Interaction Design and Children Conference (IDC '23). Association for Computing Machinery, New York, NY, USA, 740–744. https://doi.org/10.1145/3585088.3594487
Elizabeth Edwards, John Edward Vidler, Lorraine Underwood, Elisa Rubegni, and Joe Finney. 2023. Supporting fieldwork for primary education with computing - micro:bit, clip:bit and game controllers. In Proceedings of the 22nd Annual ACM Interaction Design and Children Conference (IDC '23). Association for Computing Machinery, New York, NY, USA, 553–557. https://doi.org/10.1145/3585088.3593897
- for PXT/microbit