Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Fix the switch for CPX #337

Merged
merged 2 commits into from
Apr 17, 2020
Merged

Fix the switch for CPX #337

merged 2 commits into from
Apr 17, 2020

Conversation

xnkevinnguyen
Copy link
Contributor

@xnkevinnguyen xnkevinnguyen commented Apr 17, 2020

Description:

This is a fix for CPX switch issue reported recently AB#34647

Repro step with sample code
1- Open simulator CPX and run following code:

from adafruit_circuitplayground import cp

while True:
    if cp.switch:
        cp.pixels[0] = (0, 0, 255)
    else:
        cp.pixels[0] = (0, 0, 0)

2- Click on the switch here:
image

Expected behaviour: The switch should become red when on and the led should light up

Current behaviour: Clicking on the switch doesnt properly toggle

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Limitations:

Please describe limitations of this PR

Testing:

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • My code has been formatted with npm run format and passes the checks in npm run check
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@xnkevinnguyen xnkevinnguyen merged commit 5d88fc5 into dev Apr 17, 2020
@xnkevinnguyen xnkevinnguyen deleted the users/t-xunguy/switch-fix branch April 17, 2020 19:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants