[Microbit-Python] Help - ultrasound hcsr04 sensor

Jim Mussared jim at groklearning.com
Fri Jul 21 00:15:32 EDT 2017


The bit:bot is totally amazing - we just got one for the office here. :D

I actually got the ultrasonic sensor working earlier this week (using
a similar approach to the temp/humidity sensor in the previous thread,
and also similar to the code you linked to), but it required changes
to the micropython firmware. I'm happy to share a hex file that works
if you're happy to use uFlash (or manually patch the uflash.py in Mu).

FYI, If you're using the latest firmware in Mu / uFlash, you might
also notice crashes when controlling the robot and using the radio at
the same time. This is actually fixed, but there hasn't been a
firmware release since then. However I noticed that the latest
firmware breaks support for NeoPixels -- I have a fix for this too but
I don't understand why it broke. It's on my list for this weekend to
investigate and raise some bugs / send some PRs to the micro:bit
micropython repo.

On 21 July 2017 at 13:17, Nicholas H.Tollervey <ntoll at ntoll.org> wrote:
> I believe this is a known problem and will be fixed in the next release
> (in the not-too-distant-future).
>
> N.
>
> On 21/07/17 00:00, T Gamble wrote:
>> Hi,
>>
>> The MicroPython solution posted here on
>> GitHub https://github.com/fizban99/microbit_hcsr04 will not enable me to
>> use the Mirco:Bit and Bit:Bot (seeBit:Bot
>> <http://4tronix.co.uk/blog/?p=1490>) and HC-SR04 ultra sound sensor. The
>> bit:bot provides pin15 for accessory connections, whereas the posted
>> solution uses multiple pins. (I am restricted to pin15 on my bit:bot)
>>
>> I've tried this on Microsoft MakeCode (block editor) and it works ok -
>> setting ping trig and echo both to pin 15, from sonar block package/module.
>>
>> I've been troubleshooting thus for hours on end & all I get on the
>> MicroBit's LED matrix is the value '  -11 ' or 'Pairing Mode' weirdly!
>>
>> Please help. Thanks.
>>
>> Tim
>>
>>
>> The opinions expressed are those of the individual and not the school.
>> Internet communications are not secure and therefore the school does
>> not accept legal responsibility for the content of this message. If the
>> reader of this message is not the intended recipient, or the user
>> responsible for delivering this communication to the intended recipient,
>> you are hereby notified that any disclosure, distribution or copying of
>> this communication is strictly prohibited.
>>
>>
>>
>> _______________________________________________
>> Microbit mailing list
>> Microbit at python.org
>> https://mail.python.org/mailman/listinfo/microbit
>>
>
>
> _______________________________________________
> Microbit mailing list
> Microbit at python.org
> https://mail.python.org/mailman/listinfo/microbit
>


More information about the Microbit mailing list