[Snap!] ultrasonic sensor

Issue #18 resolved
connochaetes created an issue

As said in issue #17: "Using MicroBlocks is fun. Thank you for your work. I keep in mind, that it is still in an early, experimental state." - I am enjoying to use the ultrasonic sensor HC-SR04 with Snap! and an Arduino device. Is it possible to achieve this with the Snap! version of the MicroBlocks IDE, too?

Comments (5)

  1. Bernat Romagosa

    You would have to write your own library for Snap, and it'd be a bit of a pain because you wouldn't be able to export it or save it.

    If you still want to give it a shot, the standalone IDE comes with an ultrasound distance sensor library that you can look at for inspiration :)

    scriptImage.png

    (What I'd suggest is that you use the standalone version for now though :P)

  2. connochaetes reporter

    Thanks to you, Joan Guillén and Josep Ferràndiz. It working just fine. This issue can be closed.


    It 's nice, that I can deal with such an accurate timing out-of-the-box. Remembering an older Snap4Arduino issue, I expected more difficulties: https://github.com/bromagosa/Snap4Arduino/issues/204

    And I had to figure out a simple arrangement: Right now, I use the Micro Bit with a breakout board and a HC-SR04 ultrasonic sensor. The power supply is provided by a power bank with a CP2102 module ("USB-A to jump wire" / 3.3V for the Micro Bit AND 5V for the HC-SR04).

  3. Log in to comment