Just a shot in the dark here, but I’m wondering if anyone has ever been able to use the microbit A and B buttons for the controller? I’m sure there’s some technical hurdle I’m not familiar with…
A controller for what?
Not sure about the micro:bit, but there’s a useful extension for the arcade and adafruit editors that lets you use the device as a keyboard or mouse.
Thanks for the reply. I meant as a controller for an arcade game that you make.
I’ll check those extensions.
i’ve tried to make a controller with the micro bit but every time i tried it would fail but if you connect a dual shock controller (wired or wireless) you can play with those or you can add these games to the rasberry pi and play these games with the old nintendo controllers
@CrouchingPython I think this (links below) is what you’re looking for, its hardware that allows you to insert the Micro:bit into an analog pin converter (I’m just making up names, I don’t know what it’s called) and you can use up, down, left, right, and a button A and B input:
Another one is the same as the last one but it has a zip LED multicolour screen that is 8x8 instead of 5x5, so this is good for games which require space, such as snake - same inputs, but costs a bit more:
I know it doesn’t use the A and B button directly, but this is the closest you can get to using them. Hope this helps
Thanks for all the suggestions!
No problem @CrouchingPython!
yup for sure
Hi @CrouchingPython,
I’ve been trying to get the exact thing to work, controlling a MakeCode Arcade game in the browser(on a school Chromebook in my case) from a micro:bit(version 1.5 in my case).
What I have found out and had limited success with only 2 buttons working so far is:
The extension https://github.com/orklann/micro-bit-game-pad, which I get to work controlling e.g. Falling duck on the Chromebook from my micro:bit over Bluetooth, if I go back to the version of MakeCode for micro:bit using this link:
https://makecode.microbit.org/v1.4
(Thank you very much @Microsoft/@MakeCode for still running older versions of the editor!!!)
Then I have experimented, but not quite got to work yet, maybe not found the right version of the editor or something has been broken with Bluetooth over time, with the original repositories, which the @orklann extension above was based upon, namely @kshoji’s:
-https://github.com/kshoji/pxt-bluetooth-keyboard, and
-https://github.com/kshoji/pxt-bluetooth-gamepad
(If anyone has gotten these to work, please tell us here how!)
Then, there is @bsiever’s newer and great extension, which sadly only works on micro:bit V2s:
(Any way to get this one also working for the millions of V1s lying around in schools already, @bsiever/@MakeCode?)
Lastly, according to microbit.org, there might be some opportunities to get it working via serial, or even midi for that matter; https://support.microbit.org/support/solutions/articles/19000071689-can-i-control-my-pc-or-simulate-a-keyboard-and-mouse-
But, there seems to be some issue with lacking support for serial just in the arcade simulator/editor, when not loaded onto special supported hardware, and an ungoing, but unresolved, feature request:
https://forum.makecode.com/t/serial-block-for-makecode-arcade/10244/2
https://github.com/microsoft/pxt-arcade/issues/4145
(How is this getting along, @clmaker/@jacqueline.russell/@MakeCode?)
Anyways, it would have been really cool in a classroom situation to be able to control MakeCode Arcade from a micro:bit, or even an EV3; all done in the familiar and great MakeCode editors!!!
If anyone has another working solution for micro:bit v1, please let us know!
To the honourable and great tinkerer, @peli:
Keeping to the subject in this thread, I read with great interest your great article “Everything is a Keyboard”, which addresses exactly this issue, as well:
Having been very inspired, and also wanting to control a MCA game with e.g. a banana in the classroom, but using one of the many millions of micro:bits V1 lying around, and which started all this fun to begin with, as the intermediate, I was very sad to experience that the pxt-maker-controller extension did not load into the micro:bit MakeCode editor, nor was there a maker board for the micro:bit for the Maker editor.
https://github.com/microsoft/pxt-maker-controller
However, from my investigations, it seems that hardware-/microchip-wise, this ought also to work with the micro:bit V1 and V2 as a keyboard, and that the only reason this does not work is a small glitch in the matrix, unintentional oversight or a policy somewhere, am I right?
Could you, @peli, please either:
-Add the micro:bit to the extension’s pxt.json file, so that it will also load and work in the micro:bit MakeCode editor, or
-Add the micro:bit as a board/hardware also on maker.makecode.com, or
-Somehow else make your great extension work for the micro:bit(including V1)?
Imagine how cool this would be for the owners of the millions and millions of micr:bits lying around!!!
Hi @Vegz78,
I did look into getting my blehid extension to work on micro:bit v1, but it requires a lot of reengineering. Bluetooth also consumes a lot of memory, and I wasn’t sure the v1 would have enough (other, smaller extensions push the v1 to its limits). Between the effort required, the very real chance that it just won’t work well, and my limited time, I decided not to pursue it. If I have time this coming summer, I’ll try to look into it again.
I’m glad you have been able to get some things to work. Thanks for sharing your findings and work!
Bill
P.S. It looks like the https://github.com/microsoft/pxt-maker-controller is only for AdaFruit’s products, not the micro:bit. I think it uses features and libraries that don’t exist on the micro:bit.
Thanks for your quick response, @bsiever!
Yeah, I saw your comment “V1 build environment lacks the MicroBitBLEService class used as the base for HIDService.” on GitHub, and was going to contact you further there for comments on possibilities.
But now I(and @MakeCode and much of the community) got your answer(and challenge) here instead, which probably is much better and to a larger audience.
Thank YOU very much for YOUR much bigger contribution with your microbit-pxt-blehid extension, even though it so far only works for the micro:bit V2. I wish I could help you with the development for the V1, but I am not close to that level of programming proficiency yet, and maybe I won’t be ever…
But I can say this: There is, at least, an enormous potential market of users out there for such a plugin, with all the multi-millions of micro:bit V1s around, many never being used. And it would widen the the scope of fun use cases and projects, if you ever got the time - and maybe some help - to look at it again!
Br,
Vegard
And for the record, I am hoping that @peli and @makecode are not trying to avoid giving a response here regarding @peli’s https://github.com/microsoft/pxt-maker-controller, just because of @bsiever P.S…
@peli’s legendary article clearly states “…and other MakeCode Maker compatible boards”.
From what I can gather, the micro:bit would indeed probably be compatible with the MakeCode Maker editor, but it just isn’t there, most likely, because it has its own microbit.makecode.com editor instead.
I might, of course, be wrong, and that there it’s a huge difference between the micro:bit and all the other supported boards, but I was hoping for a little more information directly from @peli/@MakeCode.
Maybe the community could mod @peli’s extension, or it might even be only a quick fix for him to do it himself, and get thousands of new fans in the process?
Hi Vegz78,
I requested the serial block for makecode arcade because I wanted to use input from a Unity app to a pybadge/pygamer like I was able to do to with a microbit in Makecode. Since it was not available, I did not pursue it further. Good luck with your research.
clmaker
Finally found a fork of @orklann’s gamepad extension above by @fdalvi, which worked with both buttons and axes on the micro:bit V1.5/FW0249 as a controller over Bluetooth for MakeCode Arcade games running in the browser(school chromebook in my case):
Had to compile with an older version 3.1.4 of the micro:bit MakeCode editor:
https://makecode.microbit.org/v3.1.4
Tested with @LuayBenAlaya’s “Button tester”:
https://forum.makecode.com/t/button-tester/7614
Thank you very much, @fdalvi!!!
PS: Here’s a quick implementation of the controller logic for the micro:bit, anyone’s interested in trying it out quickly:
https://makecode.microbit.org/v3.1.4#pub:_AJR9tV3PEURs
By the way, an update from @peli why the pxt-maker-controller & keyboard extensions do not work on the micro:bit V1:
It’s not possible on v1 as daplink does not implement keyboard hid.
Does it ring a bell for anyone why this connects the micro:bit as a gamepad over Bluetooth and works as a charm in MakeCode Arcade in the browser on a Chromebook, while it only connects as a gamepad or HID device via Bluetooth on Win10, HackOS Mojave and Debian Buster(RPi), but the button presses are not picked up in MakeCode Arcade in the browser on any of these machines?
Win10 sometimes complains about a low energi GATT driver error, as well.
Does the Chromebook provide certain gamepad drivers which might be missing on the others, or is the problem likely in the micro:bit @fdalvi extension? And if driver problems, which drivers could work on Win, MacOS and Linux?