Microsoft MakeCode

OMG life is so much better

control.reset()

This causes the program to exit. I’m having all the kiddos add this to the bottom of their code.

2 Likes

Something like this?

Yes it would make more sense to have something under brick instead of me randomly finding it under advanced control reset. I would suggest “Exit Program” more implicit. Also shouldn’t be under Power should go next to Clear screen

How about buttons? it’s a button after all.

Yes that sounds logical. Just having it anywhere in brick and named exit program will make it way more discoverable

It will go in beta soonish. /beta is based on pxt v5 so you’ll get functions with arguments as well.

1 Like

Two questions:

  1. When will “exit program” appear with the offline app? I’ve had 10 year old kids get confused with the downloading + dragging process and would like to try using the offline app in a classroom setting because it looks like it downloads directly to the EV3.

  2. This “exit program” really is important for the kids to be able to connect their code with the robot’s performance. Tomorrow I start a new group and am telling them to use the Getting Started --> Try series of lessons as their first exposure to the EV3.

Yet the second Try exercise is to connect a large motor and have it turn one revolution. The lesson gives them the code and tells them to download and run it and then asks if the motor turned one rotation before stopping.

And the motor doesn’t stop! Without the “exit program” block the motor just keeps turning when they follow the online instructions, and they’re confused. Also, the simulator stops after one rotation but the robot doesn’t, another source of confusion for beginning students.

Will this online lesson get updated to add the “exit program” block?

“Exit Program” is availabe in the latest released editor 1.2.26 (and the offline editor as well). I will see about fixing the “Try” lesson.

Could be “my bad” here. I was in a hurry to get ready for the new group of kids and now that I’m getting my notes in order it looks like my program that won’t stop has an error. I don’t have the EV3 with me right now, but I should get time tomorrow to double-check my code.

If you find, click share and send us the link!

OK, now the tutorial to turn the motor one revolution works. This is good. I’m trying to be more methodical with my testing and have been able to repeat the endless turning: by setting the number of rotations to 0!
I’m restarting the simulator with every test now and that has helped. But the endless turning is repeatable and it’s the same on the simulator and on the EV3:

About

And it makes sense: there is no “stop” condition so it’s like just turning the motor on.

We probably confuse “undefined” and “0” in our code to determine if a rotation is provided or not. We should correctly handle 0 as do nothing and stop. Thanks for digging.