aseba-community / thymio-vpl2

Next generation VPL for Thymio using Qt Quick from Qt 5.x
GNU Lesser General Public License v3.0
2 stars 5 forks source link

Break statement in vpl timer trigger event #2

Closed TiborUdvari closed 8 years ago

TiborUdvari commented 8 years ago

I'm trying to do a timer delayed toggle from State A to State B and then from State A to StateBindefinitely.

Here is an image of what I'm trying to do. Here is the aesl file as well. Thymio should switch indefinitely from red to blue.

I don't think it's possible to do this only using VPL. (which I'm trying to do because I'm doing a workshop for kid)

Do you think there would be a fix for this? Like an else-if statement in this block or the state copying and return statement in if block?

I'm not sure if this would have any consequences in other use cases though.

What do you think?

onevent timer0
    timer.period[0] = 0
    if state[1] == 1 then
        call leds.top(32,0,0)
        new_state[1] = 1
        new_state[3] = 1
    end
    if state[1] == 1 and state[3] == 1 then
        call leds.top(0,0,32)
        new_state[1] = 1
    end

    call math.copy(state, new_state)
    callsub display_state
stephanemagnenat commented 8 years ago

This bug tracker is related to VPL2, a state-machine and tablet based development version of next generation VPL.

It seems your question is related to VPL as in Aseba 1.4. If so, please post in the Aseba repository here: https://github.com/aseba-community/aseba

TiborUdvari commented 8 years ago

I'm sorry, I wasn't aware. I'll repost it over there.