error in the code!

int green = A3; int red = A2; intPinP = 2; intpinE = 5; intpinF = 6; intpinG = 7; intpinH = 8; intpinA = 9; //input A intpinB = 10; //input B intpinC = 11; //input C intpinD = 12; //input D int s1Pin = A0;//pin of LDR int n1Pin = A1; int number = 0; int threshold = 700 int s1Analog; int s1Digital; int n1Analog; int n1Digital; int convert; int tens = 0;

void setup() { pinMode( pinA, OUTPUT ); pinMode(pinB, OUTPUT ); pinMode(pinC, OUTPUT ); pinMode(pinD, OUTPUT ); pinMode(pinE, OUTPUT ); pinMode(pinF, OUTPUT ); pinMode(pinG, OUTPUT ); pinMode(pinH, OUTPUT ); pinMode(PinP, OUTPUT ); Serial.begin(9600); }

void loop() { digitalWrite(PinP,HIGH); analogWrite(green,255); readData(); convert = number; conversion();

if((n1Digital==0)&&(s1Digital==1)) { counterFilter(); } if((n1Digital==1)&&(s1Digital==0)) {counterFilter2(); }

Serial.print("Number : "); //Only used to test the parameters. Serial.print(number); Serial.print("\t Analog : "); Serial.print(s1Analog); Serial.print("\t Digital : "); Serial.println(s1Digital);

if(number==10) { number = 0; tens++; }

conversion2();

if((number==0)&&(tens==5)) { analogWrite(green,0); analogWrite(red,255); conversion2(); } else {analogWrite(red,0); analogWrite(green,255); } }

voidreadData() { s1Analog = analogRead(s1Pin); n1Analog = analogRead(n1Pin); AnalogtoDigital(); }

voidAnalogtoDigital() //Function for conversion of Analog Data to Digital Data { if(s1Analog > threshold) s1Digital = 1; else s1Digital = 0; if(n1Analog > threshold) n1Digital = 1; else n1Digital = 0; }

voidcounterFilter() //Function for filtering of the same value of inputs. Kapagtumambaysa sensor ungtao. { while((n1Digital==0)&&(s1Digital==1)) { readData(); } if((n1Digital==1)&&(s1Digital==1)) { while((n1Digital==1)&&(s1Digital==1)) {readData(); } } if((n1Digital==0)&&(s1Digital==1)) {counterFilter;} if((n1Digital==1)&&(s1Digital==0)) { while((n1Digital==1)&&(s1Digital==0)) {readData(); } number++; } n1Digital=0; s1Digital=0; readData(); } void counterFilter2() { while((n1Digital==1)&&(s1Digital==0)) { readData(); } if((n1Digital==1)&&(s1Digital==1)) { while((n1Digital==1)&&(s1Digital==1)) {readData(); } } if((n1Digital==1)&&(s1Digital==0)) {counterFilter2;} if((n1Digital==0)&&(s1Digital==1)) { while((n1Digital==0)&&(s1Digital==1)) {readData(); }

if ((tens>0)&&(number==0)) {number=10; tens--; }

} number--; n1Digital=0; s1Digital=0; readData(); }

void conversion() //Conversion of ABCD values to Seven segment display { switch(convert) { case 0 : digitalWrite( pinA, LOW ); digitalWrite(pinB, LOW ); digitalWrite(pinC, LOW ); digitalWrite(pinD, LOW ); break;

case 1 : digitalWrite( pinA, LOW ); digitalWrite(pinB, LOW ); digitalWrite(pinC, LOW ); digitalWrite(pinD, HIGH ); break;

case 2 : digitalWrite( pinA, LOW ); digitalWrite(pinB, LOW ); digitalWrite(pinC, HIGH ); digitalWrite(pinD, LOW ); break;

case 3 : digitalWrite( pinA, LOW ); digitalWrite(pinB, LOW ); digitalWrite(pinC, HIGH ); digitalWrite(pinD, HIGH ); break;

case 4 : digitalWrite( pinA, LOW ); digitalWrite(pinB, HIGH ); digitalWrite(pinC, LOW ); digitalWrite(pinD, LOW ); break;

case 5 : digitalWrite( pinA, LOW ); digitalWrite(pinB, HIGH ); digitalWrite(pinC, LOW ); digitalWrite(pinD, HIGH ); break;

case 6 : digitalWrite( pinA, LOW ); digitalWrite(pinB, HIGH ); digitalWrite(pinC, HIGH ); digitalWrite(pinD, LOW ); break;

case 7 : digitalWrite( pinA, LOW ); digitalWrite(pinB, HIGH ); digitalWrite(pinC, HIGH ); digitalWrite(pinD, HIGH ); break;

case 8 : digitalWrite( pinA, HIGH ); digitalWrite(pinB, LOW ); digitalWrite(pinC, LOW ); digitalWrite(pinD, LOW ); break;

case 9 : digitalWrite( pinA, HIGH ); digitalWrite(pinB, LOW ); digitalWrite(pinC, LOW ); digitalWrite(pinD, HIGH ); break; } }

void conversion2() { switch(tens) { case 0 : digitalWrite( pinE, LOW ); digitalWrite(pinF, LOW ); digitalWrite(pinG, LOW ); digitalWrite(pinH, LOW ); break;

case 1 : digitalWrite( pinE, LOW ); digitalWrite(pinF, LOW ); digitalWrite(pinG, LOW ); digitalWrite(pinH, HIGH ); break;

case 2 : digitalWrite( pinE, LOW ); digitalWrite(pinF, LOW ); digitalWrite(pinG, HIGH ); digitalWrite(pinH, LOW ); break;

case 3 : digitalWrite( pinE, LOW ); digitalWrite(pinF, LOW ); digitalWrite(pinG, HIGH ); digitalWrite(pinH, HIGH ); break;

case 4 : digitalWrite( pinE, LOW ); digitalWrite(pinF, HIGH ); digitalWrite(pinG, LOW ); digitalWrite(pinH, LOW ); break;

case 5 : digitalWrite( pinE, LOW ); digitalWrite(pinF, HIGH ); digitalWrite(pinG, LOW ); digitalWrite(pinH, HIGH ); break; } }

intPinP = 2;
intpinE = 5;
intpinF = 6;
intpinG = 7;
intpinH = 8;
intpinA = 9;   //input A
intpinB = 10;  //input B
intpinC = 11;  //input C
intpinD = 12;  //input D
sketch_mar29a.ino:3:1: error: 'intPinP' does not name a type
sketch_mar29a.ino:4:1: error: 'intpinE' does not name a type
sketch_mar29a.ino:5:1: error: 'intpinF' does not name a type

You need a space between the 'int' keyword and the variable name.

sketch_mar29a.ino:16:17: error: expected ',' or ';' before 'int'

You need a semicolon at the end of Line 15:

int threshold = 700
                int s1Analog;
sketch_mar29a.ino: In function 'void loop()':
sketch_mar29a.ino:41:12: error: 'readData' was not declared in this scope
sketch_mar29a.ino:46:19: error: 'counterFilter' was not declared in this scope

Missing spaces between the keyword 'void' and the function names further down that prevents the function from being declared properly:

voidreadData()
voidAnalogtoDigital()  //Function for conversion of Analog Data to Digital Data
voidcounterFilter()  //Function for filtering of the same value of inputs. Kapagtumambaysa sensor ungtao.

Fix all those errors and the sketch compiles!

thank you so much..now its working...but is there any possible way to shorten the codes?

Make sure you read the two posts at the top of this Forum by Nick Gammon detailing the guidelines for posting here, especially on how to properly post source code. Also, use Ctrl-T in the IDE to format the code before posting...it will help us help you.

lally20:
is there any possible way to shorten the codes?

Yes. In general if you have variables that look like this:

int pinA = 9;   //input A
int pinB = 10;  //input B
int pinC = 11;  //input C
int pinD = 12;  //input 
int pinE = 5;
int pinF = 6;
int pinG = 7;
int pinH = 8;

You should replace all of those with one array:

int pins[] = {9, 10, 11, 12, 5, 6, 7, 8};
const int pinCount = sizeof pins / sizeof pins[0];

Then you an use ‘for’ loops:

    for (int i=0; i<pinCount; i++)
        pinMode(pins[i], OUTPUT);

Those could all be byte also, not int. Save on SRAM.