You can write full strings and variable values to the serial port however and so by connecting your micro:bit into a computer using a USB cable and firing up a terminal application like Putty, you can monitor serial output as your micro:bit code executes.
This is a great way to get to the bottom of weird code problems you just can't figure out!
Here's how you'd do this from C/C++
uBit.serial.printf("P0:%d P1:%d P8:%d P12:%d\r\n", pin0, pin1, pin8, pin12);
No comments:
Post a Comment
Note: only a member of this blog may post a comment.