Open smfox10 opened 1 year ago
Migth have been fixed, please test again.
This problem still exists
https://github.com/microsoft/jacdac/assets/3880290/244b71ef-d035-4b28-b71c-3896a388454b
@smfox10, we have a fix: https://github.com/microsoft/pxt-jacdac/pull/101
Please test.
@smfox10 reopen in the problem is still there
I just managed to setup a local pxt-microbit and jacdac environment. It looks like the servo module only response to one of the enable packets sent to the servo. trace.jd.txt
The problem is possibly caused by the firmware missed the timing to receive some of the jacdac packets. This will only happen when both servos are powered off, and the dedicated position is different from the current position.
And this can be reproduced in the dashboard by following steps:
console.log("Servo test")
basic.showIcon(IconNames.Heart) // basic.pause(100) // modules.servo1.setEnabled(true) // modules.servo2.setEnabled(true) // basic.showIcon(IconNames.SmallHeart)
input.onButtonPressed(Button.A, function () { modules.servo1.setAngle(0) modules.servo2.setAngle(0) })
input.onButtonPressed(Button.B, function () { modules.servo1.setAngle(90) modules.servo2.setAngle(90) })
2. Reset the servo module from dashboard. Make sure both servo module is powered off. **This is important**
3. click button B, both servo service will try to power on the servo, then move to 90.
Only one of the servo may got powered on or moved, and there is massive RX t/o error in the log.
Here is some codalLogStore dump:
0x20000010
https://makecode.microbit.org/_J583d5P8XeYL
1、They all work fine in the dashboard.I set their angle to 90 2、I download this program 3、I press button A ,In fact, both servos should be turned to 0 degrees,but Servo2 don't work.(first time) 4、I press button A again,Servo2 works fine
https://github.com/microsoft/jacdac/assets/3880290/3b9c5324-9496-437f-b6a3-2e8b58f76b7b