Open tgamble941 opened 7 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.
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 HCSR04.txt