Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After switching to "BLOCKS" mode, the program didn't run #674

Closed
Helen09 opened this issue Mar 29, 2018 · 6 comments
Closed

After switching to "BLOCKS" mode, the program didn't run #674

Helen09 opened this issue Mar 29, 2018 · 6 comments

Comments

@Helen09
Copy link

Helen09 commented Mar 29, 2018

Repro steps:
• Navigate to https://makecode.adafruit.com/beta#editor
• Copy the below code on "JavaScript" pane and the click button A

let strip = light.createStrip()
input.buttonA.onEvent(ButtonEvent.Click, () => {
strip.showAnimation(light.cometAnimation, 2000)
})

• Switch to "BLOCKS" mode and click button A again

Expect result:
After clicking button A, the program should run in "BLOCKS“ mode as in 'JavaScript' mode
Actual result:
After switching to "BLOCKS" mode, the program didn't run
12347

@samelhusseini
Copy link
Contributor

There's something funny going with the decompilation. @riknoll

let strip = light.createStrip()
input.buttonA.onEvent(ButtonEvent.Click, () => {
strip.showAnimation(light.cometAnimation, 2000)
})

is decompiled into
screen shot 2018-04-24 at 9 16 41 pm

and then back to

let strip: light.NeoPixelStrip = null
input.buttonA.onEvent(ButtonEvent.Click, function () {
    strip.showAnimation(light.cometAnimation, 2000)
})
strip = light.createStrip(pins.A1, 0)

hence why it's not running.

@samelhusseini
Copy link
Contributor

Same issue here: #626

@samelhusseini
Copy link
Contributor

Another here: #603

@samelhusseini
Copy link
Contributor

Another dupe here: #593

@pelikhan
Copy link
Member

pelikhan commented Jun 6, 2018

952869c

@pelikhan pelikhan closed this as completed Jun 6, 2018
@lock
Copy link

lock bot commented Sep 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants