Raspberry Pi & Arduino Communication to Odrive

Hi Everyone,

I am building a wheelchair project using Odrive (what a learning journey!) I finally got Odrive to work with Arduino and it executes almost flawlessly. Now when I try to run the exact same code using raspberry pi (I plan on making an app that can be used wirelessly) I am getting an error in ‘Odrivearduino.cpp’ that says "class string has no member named ‘toFloat’ " this is due to toFloat only being available in certain older Arduino versions. Is anyone else having this issue? If so, how did you resolve it? I will write a new code if I have to but I am hoping there is an easier solution I may have missed.

Thank you!

-Alex Rivera

Umm, a Raspberry Pi isn’t an Arduino? I assume toFloat doesn’t exist in whatever string implementation you’re using on the RPi.

As wetmelon says, you don’t have Arduino library functions on the Pi because it’s not an Arduino.
In the case of toFloat, you can use strtof instead
man strtof
will tell you how to use it.

There are probably a lot of other Arduino functions that you need to swap out for equivalent standard library functions though.

1 Like

Should have clarified!!! I had the odrive and arduino hooked up to my laptop then switched the same setup on pi it didn’t work. Of course it’s not the same thing :slight_smile: