Hi. I am making a biped robot with 11 servos, an ultrasonic sensor and two IR leds and two recievers. I connected the 11 servos on pins 0 - 10 and the ultrasonic sensor on pins 11 and 12. So clearly I am out of pins for the IRs. So is it possible to connect them on Analog inputs? If so, can I define them like how I do to digital ones ( Like int Xxx (15); for A1 and int XXX (16); for A2?)
Yes, that is right. Then in setup() set the pinMode to INPUT or INPUT_PULLUP as needed. Analog pins are digital pins with the special purpose of analog input.