Davidelvig
Well-known member
I'm using 4 pins to rapidly detect changes in finger touches. The pins connect through 3-4" patch wires to a small round-headed screw.
A set of four reads (one of each pin) takes about 600 microseconds to complete when no screw heads are touched.
When all four screw heads are touched, the time increases to about 3000 microseconds.
Each pin "rests" untouched at about a touchRead value of 800-1100 (second column below - arbitrary units as far as I know),
and spikes to 5000-6500 when touched (all four screws touched here)
I think I can live with the 3000 micros, though it seems as though I have some headroom.
Any way to adjust touchRead to stop and return when it reaches a threshold (above which you don't care how high it gets)?
I saw a post about this in the past (on perhaps truncating the time of touchRead() above certain time thresholds), though I can't find it now.
A set of four reads (one of each pin) takes about 600 microseconds to complete when no screw heads are touched.
Loop Count: 464056 Last Loop Time: 598 microseconds
Loop Count: 464057 Last Loop Time: 597 microseconds
Loop Count: 464058 Last Loop Time: 595 microseconds
Loop Count: 464059 Last Loop Time: 598 microseconds
Loop Count: 464060 Last Loop Time: 600 microseconds
Loop Count: 464061 Last Loop Time: 598 microseconds
Loop Count: 464062 Last Loop Time: 598 microseconds
Loop Count: 464063 Last Loop Time: 598 microseconds
Loop Count: 464064 Last Loop Time: 594 microseconds
Loop Count: 464065 Last Loop Time: 600 microseconds
When all four screw heads are touched, the time increases to about 3000 microseconds.
Loop Count: 826493 Last Loop Time: 3139 microseconds
Loop Count: 826494 Last Loop Time: 2972 microseconds
Loop Count: 826495 Last Loop Time: 3147 microseconds
Loop Count: 826496 Last Loop Time: 3069 microseconds
Loop Count: 826504 Last Loop Time: 3029 microseconds
Loop Count: 826505 Last Loop Time: 3109 microseconds
Loop Count: 826506 Last Loop Time: 3095 microseconds
Loop Count: 826507 Last Loop Time: 3120 microseconds
Loop Count: 826508 Last Loop Time: 3063 microseconds
Each pin "rests" untouched at about a touchRead value of 800-1100 (second column below - arbitrary units as far as I know),
Valve LastTouchVal TouchTime IsPressed Pin Length
1 869 127 0 16 2
2 1057 151 0 17 1
3 837 122 0 1 3
4 842 123 0 0 5
and spikes to 5000-6500 when touched (all four screws touched here)
Valve LastTouchVal TouchTime IsPressed Pin Length
1 6470 868 1 16 2
2 6420 860 1 17 1
3 5895 789 1 1 3
4 5299 713 1 0 5
I think I can live with the 3000 micros, though it seems as though I have some headroom.
Any way to adjust touchRead to stop and return when it reaches a threshold (above which you don't care how high it gets)?
I saw a post about this in the past (on perhaps truncating the time of touchRead() above certain time thresholds), though I can't find it now.
Last edited: