fizban99 / microbit_hcsr04

micro:bit library for the HC-SR04 ultrasonic sensor
MIT License
18 stars 6 forks source link

using this with the Bit:Bot #1

Open tgamble941 opened 7 years ago

tgamble941 commented 7 years ago

I've tried your code on the Bit:Bot (see here) which only allows pin15 for accessory connections, but can't seem to get it to work.

In Microsoft MakeCode block editor, it seems to work fine using both pin15 for trig and echo. (see below)

Could you provide any help for a micropython solution for the above? (You can see your solution, with my edits below)

thanks makecode snippet HCSR04.txt

rhubarbdog commented 6 years ago

you can only set echo and trigger to same pin number if its a 3 pin device.power, ground and data. the HCSR04 has 4 pins power, ground trigger and echo. they are 4 different pins. i'm going to raise an issue at makecode i've seen this on other forums. without disconnecting say the neopixel or deactivating display bit:bot has only one unused pin.