# PS2 Controller extension

**URL:** <https://forum.makecode.com/t/ps2-controller-extension/1409>\
**Category:** micro:bit\
**Tags:** extension\
**Created:** [March 14, 2020, 8:11am UTC](https://forum.makecode.com/t/ps2-controller-extension/1409 "2020-03-14T08:11:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbraad](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gbraad/32/338_2.png) [@gbraad](https://forum.makecode.com/u/gbraad)\
**Post date:** [March 14, 2020, 8:11am UTC](https://forum.makecode.com/t/ps2-controller-extension/1409/1 "2020-03-14T08:11:31Z")

</div>

Still testing it, as it can be finicky when it comes to timing. But I have a small test here:

> **[test-ps2-controller](https://makecode.microbit.org/15142-31888-96343-20753)**
>
> Made with ❤️ in Microsoft MakeCode for micro:bit.

and the extension itself is at [https://github.com/gbraad/pxt-ps2-controller](https://github.com/gbraad/pxt-ps2-controller)

 ![](https://pixelfed.social/storage/m/113a3e2124a33b1f5511e531953f5ee48456e0c7/19dc92584914ec557fc762f338ebb32807264507/d3adjPDZRSNDfhwGK9UG30asUYaa2IMT7BibF390.jpeg)

It depends on another extension that handles the reversing of the bits, as the SPI communication of mbed is not configurable to be LSB first, like the PS2. It only does MSB and since the nRF51 is a Cortex-M0 there is no `rbit` functionality either… hence, [https://github.com/gbraad/pxt-reversebit](https://github.com/gbraad/pxt-reversebit) to perform `rbit` or `rbuffer` based on a table.

The extension is finicky. If something slows down, due to serial communication or showing leds, the communication with the controller could get lost/out of sync. I am still trying to see what can be done to improve this, and perhaps have to use the `interval` extenstion I created? Feedback is much appreciated.

---

<div class="post-metadata">

**Author:** ![huydhoang](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/huydhoang/32/2641_2.png) [@huydhoang](https://forum.makecode.com/u/huydhoang)\
**Post date:** [December 5, 2020, 6:15am UTC](https://forum.makecode.com/t/ps2-controller-extension/1409/2 "2020-12-05T06:15:49Z")

</div>

Amazing implementation! What are the minimum hardware parts required to use a PS2 controller with microbit?

---

<div class="post-metadata">

**Author:** ![Pavlos-Efstathiou](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pavlos-efstathiou/32/2868_2.png) [@Pavlos-Efstathiou](https://forum.makecode.com/u/Pavlos-Efstathiou)\
**Post date:** [December 28, 2020, 5:40pm UTC](https://forum.makecode.com/t/ps2-controller-extension/1409/3 "2020-12-28T17:40:19Z")

</div>

Wow, just wow!
