MakeCode package for convenient programming of micro:bit pins.
The MakerBit connects to the BBC micro:bit to provide easy connections to a wide variety of sensors, actuators and other components. Among other things, it features convienent pin connectors.
MakerBit | MakerBit+R with motor controller |
Sets LED pins from 5 to 16 to either on or off. The pins from pin 5 to 16 are the MakerBit LED pins. Make sure to turn off the built-in LED display when using all MakerBit LED pins.
makerbit.setLedPins(level: number)
Sets a digital pin to either on or off and configures this pin as a digital output.
makerbit.setDigitalPin(pin: number, level: number)
Sets an analog pin to a given level and configures this pin as an analog/pwm output with the duty cycle proportional to the provided value. The value is a number between 0 (0% duty cycle) and 1023 (100% duty).
makerbit.setAnalogPin(pin: number, level: number)
Returns the time-averaged input level from a sensor. The first time this is called it saves the time average. On the next calls, it subtracts this time-averaged level from the current time average and returns the absolute value.
makerbit.timeAveragedLevel(pin: number, timeSample: number)
Licensed under the MIT License (MIT). See LICENSE file for more details.
- for PXT/microbit