[Help] New to Crazyflie 2.0 - First Code

Firmware/software/electronics/mechanics
Post Reply
CoceX
Beginner
Posts: 2
Joined: Tue Apr 05, 2016 7:19 pm

[Help] New to Crazyflie 2.0 - First Code

Post by CoceX »

Hi,

Im almost at the end of my bachelor and until now I have good C and Python knowledge but Im not a Pro. :?
I bought the Crazyflie 2.0 Kit to write my own code and get more experience. But it is more difficult than expected.

Thats why I have some questions.
1.) Where can I write my code?
When I open eclipse and go to the "Project Explorer" -> Crazyflie2 - nrf - firmware -> src -> main.c
Do I have to write my code at the end of the method called "mainloop()" ???
In Project Explorer" -> Crazyflie2-firmware -> init -> main.c there is no mainloop with code... ?

2.) To understand how it works and get a general idea I would like to start with a veeeery simple code.
First I would like to blink a LED and then I would like to turn on a single motor.
For this I need a Interrupt.
How can I use it?


Thx and sorry for the stupid questions...
Che.
Member
Posts: 62
Joined: Tue Jul 28, 2015 1:47 pm
Location: Germany

Re: [Help] New to Crazyflie 2.0 - First Code

Post by Che. »

Hi,

the system is a bit complex, you need to get a general overview of how it works. Basically the two things you mentioned, you can do in simple python scripts too.

But best start with much reading, I know that can be frustrating, but in the end you are the master of the crazyflie ;)

https://www.bitcraze.io/development-overview/

Here I found a tutorial: https://wiki.bitcraze.io/projects:virtu ... mware-win7

Greets,
Che.
CoceX
Beginner
Posts: 2
Joined: Tue Apr 05, 2016 7:19 pm

Re: [Help] New to Crazyflie 2.0 - First Code

Post by CoceX »

Hi

thank you for your answer.
I read already the pages you mentioned.
But I still don't have a general idea.
There is not much docu to read.

Do you have simple tutorials to get a general idea how it works?
I already flashed my copter and hacked the LED by changing the defines but I want to learn more about it.
I don't know where to start.
Che.
Member
Posts: 62
Joined: Tue Jul 28, 2015 1:47 pm
Location: Germany

Re: [Help] New to Crazyflie 2.0 - First Code

Post by Che. »

It's not easy to give a brief explanation of the system. You will get the idea when constantly working and use trial and error principle.

When I started with experimenting with the crazyflie, I tried to understand everything that happens in the code.
I started off with main.c.

There you can see three main functions. When in eclipse holding down the ctrl-key you can hover over the functions and click them. You'll get redirected to the code of the function. There you can see whats happening in this new level. As the functions are encapsulated, this can be a bit confusing at the beginning, but there is a certain limit of levels. I don't know what exacly you want to do, but for me roughly the three or four top levels of the code were interesting.

Most code is organized in modules, which are controlled by FreeRTOS.

Greets,
Che.
Post Reply