Page 1 of 1

Debug tool

Posted: Thu Jul 23, 2020 2:35 am
by Hada Hamdi
Hi,

I'm looking for a way to print some messages, for example, I'm trying to implement a function to control the crazyflie, when I flash it, I didn't know whether it is correct or not, it returns just data in real-time about sensors. how can I display 'full log' (debug) as soon as the drone launches?

Thanks in advance!

Re: Debug tool

Posted: Thu Jul 23, 2020 8:33 am
by kimberly
Yes you can!

You can use

Code: Select all

DEBUG_PRINT("hello\n");
if you put

Code: Select all

 #include "debug.h"
on top of your script. This can be used in the same way as with printf (so with the variables at the end and %d %f etc) and you can see the messages in the console tab. Just be aware that there is a limit of how many debug messages you can send in one go before overloading the message queu's.

Also you can flash the crazyflie in debugmode (see here how to do it, but is not necessary for debug print I think). This will show more debug messages but be aware that it also removes the watchdog which provides extra runtime security. But since you are debugging anyway it should be fine (just be careful while flying)