I have found somekind of explanation to my problem in
here, but I can't solve it.
If have realized that when I define two servo pins with pinMode()-function, my arduino does just blink once the ledlight, waits some time and blinks again.
Here's my code:
int ledPin = 13;
void roller(int servoPin, int pulseLen) {
digitalWrite(servoPin, HIGH);
delayMicroseconds(pulseLen);
digitalWrite(servoPin, LOW);
delay(20);
}
void setup() {
Serial.begin(115200);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH);
}
void loop() {
for (int i = 0; i <= 15; i++) {
roller(2, 1800);
roller(3, 1200);
}
}
So if I define two pins with pinMode(), the servos doesn't work. Otherwise if I delete another of these defines, the arduino doesn't work. It doesn't matter wich one I delete. If I delete that one wich defines pin 2, the arduino works and servo in pin 3 works. If I delete define wich defines pin 3, the other servo works.
This is a little bit weird. Anyone have an answer or any questions?
Edit. I use Arduino Bluetooth ATMEGA 328