Hello Community
I'm trying to get to know the program structure of the Crazyflie and therefore I want to start simple with a "Hello World" program.
My idea is to control a LED that i connected on the Breackout expansion board on some IO pin. However I'm kind if lost in the large amount of Code and I can't even find where I would add such a command and what changes I had to make to activate this register as an output.
Can anyone help me on this?
Hello World
Re: Hello World
Hi,
Yeah, it's a big system so it may be a bit hard to dive into
For the client/crazyflie integration part you can watch these two videos (part 1, part 2) showing how to add a parameter in the Crazyflie firmware, build it, flash it and to control/log it from the client. To get an overview in text of the system architecture and communication architecture have a look at this wiki section.
But for information on how to actually drive the LED and integrate it into the firmware we don't have any doc at the moment. I would recommend having a look in the hal/src/ledseq.c file where the LEDs are controlled.
/Marcus
Yeah, it's a big system so it may be a bit hard to dive into
For the client/crazyflie integration part you can watch these two videos (part 1, part 2) showing how to add a parameter in the Crazyflie firmware, build it, flash it and to control/log it from the client. To get an overview in text of the system architecture and communication architecture have a look at this wiki section.
But for information on how to actually drive the LED and integrate it into the firmware we don't have any doc at the moment. I would recommend having a look in the hal/src/ledseq.c file where the LEDs are controlled.
/Marcus
Re: Hello World
Ok thank you for your answer. Are the IO1-IO4 on the breakout board already configured such that they can be used to return HIGH or LOW or do they also have to be configured in the first place?
Re: Hello World
Unfortunately not yet, it is in the works but first we are working on merging Crazyflie 1.0 and 2.0 code. You can have a look in exptest.c where all the expansion port pins are setup and tested.
Re: Hello World
It works pretty fine. Thx.
However I was wondering how to save these parameters to a file. If I go to the Tab "Log Blocks" all the Different Groups have a tick at the option "Write to File". However if I go the the directory ../conf/logdata/[date]
I only see the data of something that I set up in the Plotter. Is that normal? If yes, how would I write some data into a file without having to watch it in the Plotter?
Re: Hello World
1) Create a new log configuration by going to Settings->Logging configurations, select the variables you would like to log (note that there's a size limit), select the period and name, then save it
2) Go to the menu View->Tabs->Log Blocks, find your newly created block and first click the Start checkbox then the Write to file checkbox
Now the data should be written to a file in the conf/logdata directory.
2) Go to the menu View->Tabs->Log Blocks, find your newly created block and first click the Start checkbox then the Write to file checkbox
Now the data should be written to a file in the conf/logdata directory.
Re: Hello World
Oh I see the problem. The Boxes are ticked all the time even if the data is currently not logged. If I check it in the terminal, it says Started logging or Stopped logging, but the boxes stay ticked all the time