Skip to content

Commit f6e1292

Browse files
Fix servo examples.
1 parent 2c26a60 commit f6e1292

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stm32f0_hal/examples/servo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ fn main() {
1313
loop {
1414
// increase position of 0.5° each 20 ms
1515
for i in 0..360 {
16-
servo1.set_position(i as f32 / 2.0);
16+
servo1.set_position(i as f64 / 2.0);
1717
rcc::ms_delay(20);
1818
}
1919
// decrease position of 0.5° each 20 ms
2020
for i in 0..360 {
21-
servo1.set_position(180.0 - (i as f32 / 2.0));
21+
servo1.set_position(180.0 - (i as f64 / 2.0));
2222
rcc::ms_delay(20);
2323
}
2424
}

0 commit comments

Comments
 (0)