Connecting Obstacle Sensor with easyC to Micro:bit

Customer:

How do I connect an Obstacle Sensor with easyC to Micro:bit? I have a proto:bit with an easyC connector, but I’m not sure how to integrate the sensor into my program in Microsoft MakeCode.

Original message (Croatian)

Molim Vas da mi objasnite kako povezati obstacle sensor sa easyC i Micro:bit, već imam proto:bit na kojem se nalazi easyC konektor, ali mi nije jasno kako uvesti senzor u moj program kojeg porgramiram u Microsoft MakeCode programu.

[name removed]

Originally submitted via email support on 1 November 2023. Migrated to the forum for community visibility.

Soldered Support:

easyC is actually an I2C interface. I2C is a communication protocol used by all easyC boards, which enables data transfer. Here is the documentation for using I2C on micro:bit: I²C — BBC micro:bit MicroPython 1.1.1 documentation

Look at the scan() function - you should be able to detect if you have an I2C device connected via proto:bit.

I checked whether we have libraries written for micro:bit for our devices, and it appears we don’t - only for Arduino. So, using those I2C functions, you’ll need to recreate what the Arduino driver does within micro:bit. This could be straightforward for some simpler easyC devices while more complex for others.

Let me know which sensors/actuators you have in mind so I can give you more detailed guidance. I’ll also check in more detail with the team whether there are any existing libraries for this.

Original message (Croatian)

easyC je u stvari I2C sučelje. I2C je komunikacijski protokol koji koriste sve easyC ploče i on putem toga dobiva podatke. Evo dokumentacije za korištenje I2C-a u micro:bit-u: I²C — BBC micro:bit MicroPython 1.1.1 documentation

Pogledaj funkciju scan() - s njom bi trebao moći detektirati da imaš I2C uređaj spojen ako je spojen putem proto:bit-a.

Potražio sam postoje li biblioteke koje smo pisali za micro:bit za naše uređaje, i izgleda da ne postoje, već samo za Arduino. Tako da, koristeći te I2C funkcije morati ćeš rekreirati što radi Arduino driver unutar microbit-a. Ovo bi moglo biti jednostavno za neke jednostavnije easyC uređaje dok je kompleksnije za ostale.

Reci mi koje senzore/aktuatore imaš na umu pa te mogu detaljnije uputiti. Također, provjeriti ću detaljnije sa timom postoje li neke biblioteke već za to.