text: I.
  Ok I'm trying to to use the switch/case statement but can't seem to figure out what is wrong with it. I thought I was doing everything right, cause I looked around. I'm using an Arduino.
  void mydirections (int myAngle, int distance){ switch(myAngle) case 10: if (distance < range) { right(); break; }
  case 20:
  if (distance < range)
  {
  right();
  break;
  }
  default: forward(); break;}
  #include <Servo.h>
  Servo myservoL;Servo myservoR;int myservo = 2;int myAngle;int pulseWidth;
  void setup(){ pinMode(myservo, OUTPUT); myservoL.attach(9); myservoR.attach(10);}
  void servoPulse(int myservo, int myAngle){ pulseWidth = (myAngle *10) + 600; digitalWrite(myservo, HIGH); delayMicroseconds(pulseWidth); digitalWrite(myservo, LOW);}.
  Search page