Comments: How to Create a MakeCode Package for Micro:Bit

Pages

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Member #1589063 / about 5 years ago / 1

    This doesn't work at all. I get streams and streams of errors with the npm commands although I believe (note, believe) that I have installed Python 2.7, Nodejs, Visual Studio 2017 tools, as required.

    Reams of gibberish error reports right from the first npm install command.

  • gpvillamil / about 6 years ago / 1

    If I read this correctly, does this allow for integration of extensions coded in C into MakeCode?

    I notice that the bit of code that is actually reading the sensor is a .cpp file, not a .ts file.

    If this is the case, then perhaps it could be a path for easily adapting libraries for talking to various I2C sensors to work with MakeCode.

    I am especially interested in the Qwiic distance sensor (RFD77402) which has an elaborate setup and calibration process.

    • You can integrate .cpp files, you just have to create the virtual function in your .ts file. However, integrating the RFD77402 would be relatively easy to do in typescript, as you can still use the I2C bus just like normal. Also, I believe you are mistaken when you say that the .cpp is the one actually reading the sensor. In the .ts file, we read the analog value using let ADCVal = pins.analogReadPin(pin), and then pass that ADCVal to our .cpp function.The C functions just handle data, they don't actually do any communication with pins.


If you've found an issue with this tutorial content, please send us your feedback!