Servo write doesn't result in correct microsecond count

I have servos rated for 900us to 2100us for their range. I used

s1.attach(2, 900, 2100);

in setup() and

s1.write(0);
Serial.println(s1.readMicroseconds());

It prints 554, the default. Do min and max not work on the Arduino Nano 33 BLE? I can confirm that it is doing a PWM value out of the range of the servo because it doesn't move to the 0 position with this code, but using s1.writeMicroseconds(900) works. I know that the Servo.read() method doesn't work on the 33 BLE, does .write() also not work?

what is the range of values write()?

0-180. I realized when I made this post I said that I was calling .write(900), but I was actually calling .writeMicroseconds(900). Fixed that, sorry!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.