Since the discharge is performed by the PIC itself, I don't see a way to speed the process unless you connect an external Transistor in parallel with the LED. A mosfet perhaps. But that will complicate the things...
Ioannis
Since the discharge is performed by the PIC itself, I don't see a way to speed the process unless you connect an external Transistor in parallel with the LED. A mosfet perhaps. But that will complicate the things...
Ioannis
Okay; I probably ask the wrong question. Let me formulate another way.
If I recall well, the electrical law for capacitors is: Q = U x C = I x t
Where:
Q is the Load (Coulomb) - in french, la charge
U is the Voltage
C is the capacity (Farad)
I is the intensity (Amps)
t is the time (second)
A.- Is it correct/acceptable to apply this law to LEDs?
B.- Am I right to think that if I change the charging voltage of the LED, I'm going to modifiy its Load?
Roger
1- I don't know if it so much applies to LEDs as it applies to the interjunction capacitance of a diode, so, yes, by definition, it does apply to LEDs.
2- If you change the charging voltage to the LED, I would think all you'd really change is the point at which the voltage dropping from the LED would trip the PICs pin input from logic high to logic low...(one setup charges to 5v, take awhile to drop to logic 0, other setup only charges to 3v, doesn't take near as long to drop to logic 0).
Why do you want to 'speed up' the discharge process?
What end result AREN'T you getting now that you really want?
Just trying to get a handle on what you're after...
Okay skimask,
I'll try to explain clearly what I'm doing - or trying to achieve.
I have three 7seg-LEDs (three "digits") connected to a 16F88 @ 20MHz and I want them to act as buttons as well.
These three 7seg-LEDs display random numbers whithout any decimal point so I use this Dot-Point as the sensor for each 7seg-display.
I couldn't find exactly in your code how you compensated the effect of the surrouding luminosity but you have surely noticed that, in a dark environment, the discharge time of the LEDs raises drastically.
Thus, the "scanning time" until the "darkest" (or "pressed") LED is detected can be quite long. In my experience, it can take over a second.
My idea is to compensate the surrounding darkness by dropping the LED's Dot-Point voltage and hence, reduce the charging/discharging cycle.
Currently, for testing, I'm working with three digits but my final project would have ten digits (key-pad) so the time to analyse which button is pressed is important.
Voilą. Hope this helps for understanding...
It's far too amazing so I can't give-up now; got the same kick as you![]()
Roger
I'm wondering if the case of the 7 segment displays isn't killing your light input, ya know, the covering over the segments themselves...
I just kept scanning the LEDs, keeping track of the highest and lowest result every returned. Just for arguments sake, let's say the highest result I've gotten is 500. The next time I scan, the highest result is 498, I might subtract 1 from my last known highest result. Same thing for the lowest result. I don't rely on absolute numbers. I keep track of the range of inputs, recheck the inputs, see if the same input is the highest more than once, then select the most probable out of the bunch.I couldn't find exactly in your code how you compensated the effect of the surrouding luminosity
I wonder if going the other direction, lighting it up a bit more would be better.My idea is to compensate the surrounding darkness by dropping the LED's Dot-Point voltage and hence, reduce the charging/discharging cycle.
And it is a neat little thing to play with...
All in all, I think it's the 7 segment display itself that's going to cause you problems.
I have not yet dealed with this kind of touch sensors but have an idea for flotulopex: Use all 7 segments, or at least some of them, to measure the ambient light instead of the dot only. I think you will get more reliable data.
When I have the time I'd love to experiment on this.
Ioannis
Bookmarks