Currently I am using all 6 Analog Input-pins for a readout of a few sensors. (int aiPin = 3;, pinMode(aiPin, INPUT); ) I am also using 4 Servos (Servo servo1;, servo1.attach(3); ), connected to the 3,5,6 and 9 PWM pins.
The problem I have is that the AIpins conflict with the servos? If I ‘pinMode’ AIpin 3 and 5, my servos connected to DOpin 3 and 5 wont work?
I am confused, I can’t find any information? Is this normal? :X
The servo class handles all communication with the pin. You don't need to call pinMode for the servo pins.
I don't :)
The code is as follow:
int aiPin = 3;
There is a conflict between the duplicate '3' I guess. But I don't know why, since one is a AIpin and one is a DO.
My arduino sees them both as DO, therefore there is a conflict I guess, but I can do a analogRead(aiPin); successfully.
pinMode, as I understnd it, is needed (and valid) only for the digital pins. So, you ARE setting pinMode on digital pin 3.
wow, you are right.
Changed it, it works now -_-''
No one else has ever made any mistakes.
Oh, wait. That's a mistake. "Must self destruct."