sparkfun / pxt-gamer-bit

SparkFun gamer:bit package for Microsoft MakeCode - beta
https://makecode.microbit.org/pkg/sparkfun/pxt-gamer-bit
MIT License
4 stars 13 forks source link

Use pins.pushButton #6

Open pelikhan opened 3 years ago

pelikhan commented 3 years ago

https://github.com/sparkfun/pxt-gamer-bit/blob/7cef09897f638a8bfdf6a8fa4f502903b0399179/gamerbit.cpp#L15

We have a typescript API to mount buttoins,

namespace gamerbit {
    let initialized = false;
    function init() {
        if (initialized) return;
        pins.pushButton(DigitalPin.P0)
        pins.pushButton(DigitalPin.P1)
        pins.pushButton(DigitalPin.P2)
        pins.pushButton(DigitalPin.P8)
        pins.pushButton(DigitalPin.P12)
        pins.pushButton(DigitalPin.P16)
        initialized = true;
    }
}