Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
SOLVED
Heya! I've started working today with the awesome mbed on my m3pi robot. Two big questions for a newb like me.
1) I'm trying to display my current voltage (as in the normal 3pi codes.) I've tried doing so with
Battery
#include "mbed.h" #include "m3pi.h" m3pi m3pi; float bat; char buffer [4]; int main() { m3pi.locate(0,1); while(1) { bat=m3pi.battery(); bat=bat*1000; sprintf (buffer, "%f", bat); m3pi.cls(); m3pi.printf(buffer); wait(0.5); } }-I've rewritten the code and now it works.--2)Right, if you want to connect an AnalogIn you can do so straight to the mbed. http://mbed.org/handbook/AnalogIn
this is very helpful.