system
September 15, 2014, 12:30am
1
I am working with the Arduino starter kit on project 13, the capacitor sensor and keep coming up with these error messages that I am not sure how to get rid of... any help is appreciated!
I was pretty sure that I had followed the instructions carefully!
sketch_sep15a:3: error: expected unqualified-id before numeric constant
sketch_sep15a:5: error: expected ',' or ';' before 'void'
It is supremely difficult to troubleshoot code that we can't see. Post code using code tags (# button above).
system
September 15, 2014, 12:45am
3
groundfungus:
It is supremely difficult to troubleshoot code that we can't see. Post code using code tags (# button above).
Sorry!!
#include <CapacitiveSensor.h>
CapacitiveSensor capSensor = CapacitiveSensor(4,2);
int threshold = 1000;
const int ledPin = 12
void setup (){
Serial.begin (9600);
pinMode(ledPin, OUTPUT);
}
void loop (){
long sensorValue = capSensor.capacitiveSensor(30);
Serial.println(sensorValue);
if (sensorValue>threshold){
digitalWrite(ledPin,HIGH);
}
else {
digitalWrite(ledPin,LOW);
}
delay(10);
}
using the library from Arduino Playground - HomePage
Thank you!
const int ledPin = 12
Missing semi-colon after 12. That may be all that is wrong.
Not the use of code tags.
LarryD
September 15, 2014, 12:51am
5
Add a semi colon ;
const int ledPin = 12;
system
September 15, 2014, 12:52am
6
I cannot believe I didn't see that!!!! Thanks!!!
LarryD
September 15, 2014, 12:54am
7
sketch_sep15a:3: error: expected unqualified-id before numeric constant
This says line 3