Hello World

Post here to get support
Post Reply
Slaxx
Member
Posts: 86
Joined: Tue Mar 03, 2015 11:19 am
Location: Switzerland

Hello World

Post by Slaxx »

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?
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Hello World

Post by marcus »

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
Slaxx
Member
Posts: 86
Joined: Tue Mar 03, 2015 11:19 am
Location: Switzerland

Re: Hello World

Post by Slaxx »

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?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Hello World

Post by tobias »

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.
Slaxx
Member
Posts: 86
Joined: Tue Mar 03, 2015 11:19 am
Location: Switzerland

Re: Hello World

Post by Slaxx »

marcus wrote: 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.
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?
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Hello World

Post by marcus »

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.
Slaxx
Member
Posts: 86
Joined: Tue Mar 03, 2015 11:19 am
Location: Switzerland

Re: Hello World

Post by Slaxx »

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
Post Reply