Debug tool

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
Hada Hamdi
Beginner
Posts: 7
Joined: Wed Jul 22, 2020 4:19 am

Debug tool

Post by Hada Hamdi » Thu Jul 23, 2020 2:35 am

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!



kimberly
Bitcraze
Posts: 456
Joined: Fri Jul 06, 2018 11:13 am

Re: Debug tool

Post by kimberly » Thu Jul 23, 2020 8:33 am

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)

Post Reply