Need Help with was seems to be Syntax Errors

Hi aspick,

There are a few things wrong that I can see.

Like KeithRB said, you need to add breaks in your switch statements, otherwise they will all be executed one after the other.

switch (x){
case 1: one(1); break;
case 2: two(1); break:
case 3: three(1); break;
...

Secondly, you are missing semicolons in a number of places. It should look like this:

digitalWrite(1,High);
digitalWrite(2,High);
digitalWrite(3,Low);
digitalWrite(4,Low);

Thirdly, you need to add comments and indent your code! Otherwise, it is very difficult to read.

void loop() {
    sensorvalue=analogRead(A2);  // read sensor
    number=map(sensorvalue,0,1023,0,99); // convert sensor value to a number in he range 0-99
    y=number%10;  // get first digit
    x=(number/10)-y;  // get second digit
    switch (x){
        case 1: 
            one(1);
            break;
...

Also, I really can't tell what you are trying to do with your x= and y= lines. Are you trying to get the 1st and 2nd digits? I'm not sure that your code does that.

I suggest that you get a C programming book and review the syntax section. Programming can be fun, but it takes some work!

Pat.