Mentions légales du service

Skip to content

"when" for one or "when" for all

Created by: motib

One of my simplest VPL programs (likes.aesl) is behaving weirdly. I finally figured out that the change from "if" to "when" had an unexpected consequence. There are four pairs: not detect center -> stop detect center -> move forward detect right -> turn right detect left -> turn left

Consider: I place my hand in front of the right sensor and the Thymio turns right; then, I remove my hand and I expect that it will stop, but it doesn't. Apparently the "when not detect center" means that the Thymio will only fire this event when the center sensor changes from detect to not detect.

It would make things much more intuitive (for me, at least...) if the "when" were checked when a change occurred to any one of a group of events: all front sensors, all rear sensors, all bottom sensors, all buttons.