

- Capacitive sensor.h in arduino for mac serial#
- Capacitive sensor.h in arduino for mac code#
- Capacitive sensor.h in arduino for mac download#
I don't want them reading proximity, because I'm hoping to use a small 4 x 6 or 5 x 7 picture frame as the touch panel. My goal is to mount the sensors in a picture frame, and have them read through the glass. In general, the higher the resistor value, the more sensitive the sensor is. I'm also going to experiment with resistor values. I've already got several pennies soldered to single wires for test purposes, and I'm probably going to play with a little bit of aluminum foil, too. Now I'm going to build this little thing, program my Arduino Uno with this sketch, and play with it.

Here's the same sketch, without comments:ĬapacitiveSensor cs_4_2 = CapacitiveSensor(4,2) ĬapacitiveSensor cs_4_5 = CapacitiveSensor(4,5) ĬapacitiveSensor cs_4_8 = CapacitiveSensor(4,8) void setup()Ĭs_4_2.set_CS_AutocaL_Millis(0xFFFFFFFF) In fact, if we cut out all the comments it's even less intimidating.
Capacitive sensor.h in arduino for mac serial#
Serial.println(total3) // print sensor output 3ĭelay(10) // arbitrary delay to limit data to serial port Serial.print(total2) // print sensor output 2 Serial.print(total1) // print sensor output 1 Serial.print("\t") // tab character for debug window spacing Serial.print(millis() - start) // check on performance in milliseconds Long total3 = cs_4_8.capacitiveSensor(30) Long total2 = cs_4_5.capacitiveSensor(30) Long total1 = cs_4_2.capacitiveSensor(30) * Best results are obtained if sensor foil and wire is covered with an insulator such as paper or plastic sheetĬapacitiveSensor cs_4_2 = CapacitiveSensor(4,2) // 10 megohm resistor between pins 4 & 2, pin 2 is sensor pin, add wire, foilĬapacitiveSensor cs_4_5 = CapacitiveSensor(4,5) // 10 megohm resistor between pins 4 & 6, pin 6 is sensor pin, add wire, foilĬapacitiveSensor cs_4_8 = CapacitiveSensor(4,8) // 10 megohm resistor between pins 4 & 8, pin 8 is sensor pin, add wire, foilĬs_4_2.set_CS_AutocaL_Millis(0xFFFFFFFF) // turn off autocalibrate on channel 1 - just as an example * Receive pin is the sensor pin - try different amounts of foil/metal on this pin Larger resistor values yield larger sensor values. * Resistor effects sensitivity, experiment with values, 50 kilohm - 50 megohm. 10 megohm between send pin and receive pin
Capacitive sensor.h in arduino for mac code#
This is the code for the demo of Capacitive Touch from the web site linked above.

Now, I'm going to load this in and play with it over the next couple of days, and I'd suggest you might want to as well if you have an Arduino handy. it's a pretty detailed discussion of it, but what we're going to do is pretty simple and straightforward.
Capacitive sensor.h in arduino for mac download#
Before you start programming, you'll need to download and add this to your IDE (the Arduino programming environment - runs on Mac, Linux, and Windows) and include it, as well as the servo library (which is included with the IDE)ĭon't let it scare you. This is the Arduino writeup on the Capacitive Touch library we'll be using. OK, before we dive too deeply into this, a reading assignment: I've been wanting touch panels for turnout control for some time, but the cost seemed a bit silly - I knew there had to be a better way then I saw this video on youtube, and realized that by combining servo and touch screen usage with an Arduino, I could get exactly what I want very cheaply. Each turnout will require a servo, and there's a gate across the track just above the double gap that will provide a physical barrier for the switcher to keep it from running out on ther mains That works a lot better in N scale than it does in 1:1!īelow is the video that insipred me. It's made with Kato Unitrack the standard for T-Trak in N scale. My Einewinkle Chemicals quad T-Trak module - an Inglenook with a crossover and turnout access off the main line, and a gated entrance. I need 5 for the first projewct I'm doing. compare that to the cost of Tortoise motors. but when you consider you can buy ten 9G servos on Amazon for a little over a buck and a half each, and ten Arduino Nano's for $35.00 US. I'm no expert, and and this is probably going to take a while. I'm just getting started on learning Arduino and C++. I'm be using an Arduino Uno because it's what I have on hand, but you could use a Nano as well. What I have in mind is a small panel, 4 x 6 inches or so, with pennies and a single wire to each functioning as capacvitive touch sensors, servos operating the turnouts (and, a factory gate, in my case) all working through an Arduino. I mentioned in another threadf that you can build a touch-control panel, using capacitive touch, very cheaply.
