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

Simulation event error (button) #105

Open
jnthbdn opened this issue Jul 22, 2022 · 0 comments
Open

Simulation event error (button) #105

jnthbdn opened this issue Jul 22, 2022 · 0 comments
Assignees

Comments

@jnthbdn
Copy link
Contributor

jnthbdn commented Jul 22, 2022

Lors de l’exécution du code suivant, lors de l'appuis sur le bouton câblé en D0, les deux événements se déclenche...

//Inizializzazione
let weCanPushIt = true
pins.LED.digitalWrite(false)
pins.LED2.digitalWrite(false)

input.buttonD0.onEvent(ButtonEvent.Down, function () {
    if (weCanPushIt) {
        weCanPushIt = false
        pins.LED.digitalWrite(true)
        pause(3000)
        pins.LED.digitalWrite(false)
        weCanPushIt = true
    }
})

input.buttonD1.onEvent(ButtonEvent.Down, function () {
    if (weCanPushIt) {
        weCanPushIt = false
        pins.LED2.digitalWrite(true)
        pause(3000)
        pins.LED2.digitalWrite(false)
        weCanPushIt = true
    }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants