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.
Hi,
I was trying some stuff out with scanf and tried the code here.
The latest version I'm using is, but it only outputs n = 0, r = 0:
#include "mbed.h" DigitalOut myled(LED1); Serial usb(USBTX, USBRX); Serial s(p9, p10); int main() { myled=1; s.printf("R125\0"); int r; int n = s.scanf("R%3d\0", &r); printf("n = %d, r = %d\n\r", n, r); }