Skip to content
Discussion options

You must be logged in to vote

Why not code it so that, at the start of the cycle all the LEDs are turned off. During the cycle, LED's can only be turned on, as in this fragment:

            if not (-3.30 < accelx < 3.30 and -3.30 < accely < 3.30 and -1.00 < accelz < 4.30):
                led_yellow.on()
            if not (-4.30 < accelx < 4.30 and -4.30 < accely < 4.30 and -2.00 < accelz < 5.30):
                led_red.on()

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Kesse79
Comment options

@peterhinch
Comment options

Answer selected by Kesse79
@Kesse79
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants