elecfreaks / pxt-Cutebot-Pro

(酷霸/酷比特Pro)micro:bit smart cutebot pro by ELECFREAKS
https://elecfreaks.github.io/pxt-cutebotpro/
MIT License
1 stars 13 forks source link

Bug: Case 04 in the manual doesn't start cruising again #4

Open dannystaple opened 9 months ago

dannystaple commented 9 months ago

Using the code from Case 4 in the manual, the Automatic Obstacle avoidance, the robot appears to stop and turn at any obstacle (or anything in sensor range), but then does not start cruising again.

Screenshot 2023-12-26 at 14 19 48

Python code (based on the same makecode blocks as the manual):

basic.show_icon(IconNames.HEART)

def on_forever():
    sonar_reading = CutebotPro.ultrasonic(SonarUnit.CENTIMETERS)
    if sonar_reading > 2 and sonar_reading < 20:
        CutebotPro.trolley_steering(CutebotProTurn.LEFT_IN_PLACE, CutebotProAngle.ANGLE180)
    else:
        CutebotPro.cruise_control(30, 30, CutebotProSpeedUnits.CMS)
basic.forever(on_forever)

What I expected:

What happens:

I am happy to work with someone testing code on my CuteBot Pro and Microbit V2 setup to find out why it's doing this.

elecfreaks1 commented 3 months ago

Thank you for your question. I'll arrange for someone to investigate the cause