Go Down

Topic: help whit the CapacitiveSensor library  (Read 3256 times) previous topic - next topic

shon2801

hey I am trying to do a capacitive sensor and I follow the example bat it didn't compiled can you help me?

this is my code:

#include <CapacitiveSensor.h>

CapacitiveSensor   cs_2_4 = CapacitiveSensor(2,4);     
void setup()                   
{
 
   Serial.begin(9600);
}

void loop()                   
{
    long start = millis();
    long total1 =  cs_2_4.capacitiveSensor(30);
   
    Serial.print(millis() - start);       
    Serial.print("\t");                 

    Serial.println(total1);                 
   
 
    delay(1000);                             
}

 

pert

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code] // your code is here [/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please remove unnecessary blank lines from your code before posting to the forum. One or two to separate code into logical sections is fine but large spaces for no reason just make for more scrolling when we're trying to read your code.

When your code requires a library that's not included with the Arduino IDE please always post a link (using the chain link icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger(Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.

When you encounter an error you'll see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

shon2801


pert

If you had bothered to read my entire reply you would know what you need to do before I have any hope of helping you.

Go Up