Hein (fub) wrote,
Hein
fub

  • Mood:

PIC Inputs

I've been toying with inputs for the PIC, but I just couldn't get it to work. This evening, I found the cause, and it's pretty obvious: if the inputs are not connected to the ground, they start to 'hover' somewhere between 0 and 1... So now I've connected the pin to the ground (via a 10K resistor, because you don't want to short-circuit stuff when you put 4.5 V on the pin by way of an input), and it works!
I should have realised this, I guess. Anyway, I now have a circuit that shows the button's 'contact bounce' -- because it's really all analog signals (pretending to be digital), there's a threshold value for whether something is considered a 0 or 1. When you press a button, the voltage through the switch may 'bounce' a few times, generating a rapid succession of 0's and 1's.

Tomorrow, I'll test out some de-bouncing code, which was the purpose of this whole excercise.
Subscribe

  • RPGaDay 3: Tactic

    Day 3 of RPGaDay, and today’s topic is ‘tactic’. In RPG terms, a game is called ‘tactical’ if it involves…

  • RPGaDay #2: Map

    I love maps, of both real and imagined places. I love to see how things relate in space, and how seeing the layout of something allows you to make…

  • RPGaDay #1: Scenario

    The start of August marks the start of RPG-a-Day, and like with previous years, I’ll be participating! Day #1: Scenario I love reading…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments