Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

machine.time_pulse_us() makes V2 unresponsive #44

Closed
microbit-mark opened this issue Dec 14, 2020 · 3 comments
Closed

machine.time_pulse_us() makes V2 unresponsive #44

microbit-mark opened this issue Dec 14, 2020 · 3 comments

Comments

@microbit-mark
Copy link

micro:bit support: #41888

From user:

This code works as expected on V1, but makes the V2 unresponsive

import machine
dir(machine)
['__name__', 'unique_id', 'reset', 'freq', 'disable_irq', 'enable_irq', 'mem8', 'mem16', 'mem32', 'time_pulse_us']
machine.time_pulse_us(pin0,1)
-2

The -2 timeout is expected with nothing connected to the pin

using MicroPython v1.13 on 2020-11-24; micro:bit v2.0.0-beta.1 with nRF52833.

This code is used in French Python curriculum materials when the micro:bit is connected to an ultrasonic sensor.

Maybe related to #26

@microbit-carlos
Copy link
Contributor

So does the output shown in your code snippet belong to a V1?
Apologies, when you mentioned this before I thought V2 was returning -2 which is why I though it was different that issue #26 (where V2 hangs).

If that is the case we can merge this into #26. If it's not clear if that's the case could you confirm this with the user?

@crouse12
Copy link

This issue is the same as
#26

@microbit-mark
Copy link
Author

I think the snippet may belong to V1. The timeout does not reproduce for me on V2, but the device becoming unresponsive does. Closing in favour of #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants