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

Adding capacitive touch support to the simulator #94

Merged
merged 28 commits into from
Aug 9, 2019

Conversation

FMounz
Copy link
Contributor

@FMounz FMounz commented Aug 4, 2019

Description:

This PR adds the capacitive touch to the supported sensors. To simulate the touch of one of the pin click on it once. and it change its state to touch , click on it once more and it is untouched. numeric pad (key 1 to 7) can be used also to simulate the touch.The value of those pin can be retrieved by the user with cpx.touch_A

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

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

  • [ ]The touch pin change color when clicked or corresponding key pressed

-[]Add to code.py an example code that use cpx.touch_A. The Simulator should be updated accordingly. Example:

from adafruit_circuitplayground.express import cpx
while True:
cpx.red_led = cpx.touch_A6

Checklist:

  • My code follows the style guidelines of this project
  • 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

@LukeSlev
Copy link
Member

LukeSlev commented Aug 7, 2019

Stopping the simulator does not remove the "touches". Should it? I feel like that may be a good idea

Copy link
Member

@LukeSlev LukeSlev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FMounz Some comments. Also you should sync with @MichelleYAOOO because I think we want the capacitive touch to work like the buttons in terms of clicking them. people can use the keyboard if they want to press more than one at the same time. Also, there are some premade css classes that you could use in that file like https://github.com/microsoft/vscode-python-embedded/blob/users/t-famoun/capacitive_touch/src/view/components/cpx/Cpx_svg_style.tsx#L257

Copy link
Member

@LukeSlev LukeSlev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the capacitive touch pins don't work like buttons do (border stroke width gets bigger and its an orange color).They probably should

@FMounz
Copy link
Contributor Author

FMounz commented Aug 8, 2019

@LukeSlev
image
image

The color on the button is attenuated by the gray border, it is not lighter

Copy link
Member

@LukeSlev LukeSlev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FMounz Sorry one last thing can you please add python tests

@FMounz FMounz merged commit df256bd into dev Aug 9, 2019
@FMounz FMounz deleted the users/t-famoun/capacitive_touch branch August 10, 2019 11:26
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.

3 participants