Pages: [1]   Go Down
Author Topic: Capsense with Shift Registers  (Read 1540 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does anyone know how to use the Capsense Library with shift registers?

I've set up the Capsense library and made sensors that work.

And I've made this happen with LEDs:   arduino. cc/en/Tutorial/ShiftOut

but I don't understand how to integrate the two, especially at the beginning of my code, where I declare the capsense pins, for example:

#include <CapSense.h>

CapSense   cs_2_19 = CapSense(2,19);
CapSense   cs_2_18 = CapSense(2,18);        
CapSense   cs_2_17 = CapSense(2,17);        
CapSense   cs_2_16 = CapSense(2,16);      

Do I put a 19 in there? where is that on the shift register? Is the 2 then an Arduino pin 2 or a shift register pin 2? Because when I tried this, although I didn't get any sensing at all, I could get an LED to light up at the shift register's pin 2, just by declaring this at the top.

I found this:   arduino. cc/cgi-bin/yabb2/YaBB.pl?num=1272454003 so apparently there is someone working with capsense and shift registers, and is declaring it like "CapSense(2,19)" but I wasn't fully able to understand how it was all working.

I'd appreciate any help!
« Last Edit: November 04, 2010, 12:57:19 pm by dpostigo » Logged

Central Europe
Offline Offline
Edison Member
*
Karma: 7
Posts: 1220
Use the Source, Luke.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but I don't understand how to integrate the two, especially at the beginning of my code, where I declare the capsense pins, for example:

You can't mix those two easily. Setting the pins to some new, higher value won't work, the library is written to access Arduino pins only.

You will get away with replacing the output pin with a pin on a serial to parallel chip or a multiplexer, but you will have to modify the library to make that work. You might also get away with replacing the input pin with some type of analogue multiplexer, but check first if the timing for reading works with the desired circuit.

The way you asked those questions these adaptations are probably beyond your level of experience with programming. If you want to try it anyway, Capsense.cpp is the place to start.

Korman
« Last Edit: November 04, 2010, 01:42:01 pm by Korman » Logged

Pages: [1]   Go Up
Jump to: