Pin Input problem

Play with it! Please tell us which board you're using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Sandy_Crack
 
Posts: 51
Joined: Wed Aug 21, 2019 10:34 pm

Pin Input problem

Post by Sandy_Crack »

Hi,

I'm have issues with getting my CPE to react properly to an external limit switch connected up to a pin.

It works as expected if I short the terminals on the CPE with a short wire, but when I use a limit switch attached with a few feet of hook up wire , the input is always activated.
I've checked the switch and the wiring and all that checks out.
I suspect the input pin is set up for capacitance.
How do I change the input type or its tolerance .
In one of John Parks videos on touch switches he indicates you can change the tolerance by doesn't give details how.

User avatar
dastels
 
Posts: 15819
Joined: Tue Oct 20, 2015 3:22 pm

Re: Pin Input problem

Post by dastels »

Seeing your code would help. Please use the code tags around it for readability.

Dave

User avatar
Sandy_Crack
 
Posts: 51
Joined: Wed Aug 21, 2019 10:34 pm

Re: Pin Input problem

Post by Sandy_Crack »

Thanks for your offer of help.

As you will see, the code is quite simple & I don't suspect the code ( as presented ) is the issue.

Just to re-iterate
- The input behaves as expected when touched - goes low.
- When Alligator clip jumper is attached to the input ( with the other end un-terminated ) the input goes low - this makes me suspect capacitance of the wiring is the issue.
- When I take this wire to GND as the input is already triggered , nothing happens, when I take the wire to 3.3v the input reacts as ( I ) expected.

So does anyone know a way of changing the tolerance/sensitivity of the touch inputs

Thanks In Advance

Code: Select all

input.pinA4.onEvent(ButtonEvent.Up, function () {
    light.setAll(0xff0000)
})
input.pinA4.onEvent(ButtonEvent.Down, function () {
    light.setAll(0x00ff00)
})
 
Attachments
Code v2.tiff
Code v2.tiff (68.17 KiB) Viewed 69 times

Locked
Please be positive and constructive with your questions and comments.

Return to “Circuit Playground Classic, Circuit Playground Express, Circuit Playground Bluefruit”