[Question] Need help with `avr-hal` for Arduino UNO
I'm trying to get started programming for my Arduino UNO with Rust. Got my hands on some examples, got them to compile and flash to the Arduino, so far so good. Problem is once I tried modifying an example and using a float value, things started getting tricky.
The method the examples were using for printing something to the Serial was ufmt::uwriteln!(&mut serial, "Message {}", value).void_unwrap();, and it works for so long as value is not f32 or f64, and I don't get why. Is it because converting f64 into &str is hard? Why does it work natively on embedded C, then?
I tried looking up on Google, for sure someone had the same problem as me, and sure enough, I found some people saying you should use dtoa or ryu crates, both are no_std and can make the conversion I need. And to my delight, the code now compiles, but I get a giant error: linking with \\avr-gcc\ failed: exit code: 1 and several other lines.
From what I read, this is caused due to the binary being too large to flash to the Arduino, but that doesn't fully convince me, since I have already written some projects I'd say are quite large for my Arduino, and they did print floating points to the Serial.
Am I doing something dumb? Is there an easy way to print the values? This is the repository with my actual code.
As a plus, there is another function that, if called, also throws the same linking error. That function is [f64; const usize].rotate_left(usize). Why does it do so? Should I avoid using it? Is there a way I can use it?
Thanks in advance!