microsoft / pxt-sonar

A Microsoft MakeCode package to handle sonar sensors and pings
https://makecode.microbit.org/pkg/Microsoft/pxt-sonar
MIT License
42 stars 34 forks source link

Not working #1

Closed Goerni closed 7 years ago

Goerni commented 7 years ago

Hi, with the HC-SR04 ultrasonic distance sensor and the pxt.microbit,org editor for the BBC Microbit the Package don't work.

The output is always "0".

The hardware works fine (tested with an Arduino Uno)

Shure that this package should work?

Best regards

leomazzi commented 7 years ago

HC-SR04 works with 5V, microbit works with 3V - are you powering the HC-SR04 with 5V and reducing the voltage on the "echo" output with resistors or other from 5V to 3V?

Goerni commented 7 years ago

No, i didn't. I'm sorry, thanks for the hint! ;) I will try this.

Goerni commented 7 years ago

So here is one with 3V (if any one is interessted)

http://www.ebay.de/itm/3V-5-5V-HC-SR04-Ultrasonic-Module-Distance-Measuring-Sensor-for-Arduino-UNO-MCU-/381496724507