/* Controlling a Satellite Dish's (BUD) Polarotor Servo with a Modern FTA receiver... Released under the GPL by Nathanial P Hendler http://retards.org/ 2009 For the arduino v1.0 */ #include // Defines // Hardware Defines #define PotPinV 0 #define PotPinH 1 #define ServoPin 9 // Must be pin 9 or 10 #define PolarityPin 2 Servo myServo; // create servo object to control a servo int potValueV, potValueH; int polarityVoltage; void setup() { myServo.attach(ServoPin); // attaches the servo pin to the servo object pinMode(PolarityPin, INPUT); } void loop() { // Read Pots... potValueV = analogRead(PotPinV); potValueH = analogRead(PotPinH); potValueV = map(potValueV, 0, 1023, 0, 179); potValueH = map(potValueH, 0, 1023, 0, 179); // Figure out if we want to possition servo to V or H... polarityVoltage = digitalRead(PolarityPin); if (polarityVoltage == HIGH) { myServo.write(potValueH); } else { myServo.write(potValueV); } delay(100); }