User Tools

Site Tools


doc:crazyflie:api:firmware:deck:howto

This is an old revision of the document!


Making your first Deck driver

This howto is going to describe step-by-step how to make and flash your first Crazyflie 2.0 deck driver.

Development environment

You should have the crazyflie-firmware and crazyflie-clients-python cloned in the same folder. If you are using the Bitcraze VM this is already the case.

For the rest of the howto you will work in the crazyflie-firmware project.

Writing the driver

Deck drivers are in the deck/driver/src folder. Create this file named hello.c in the deck/driver/src folder:

hello.c
#define DEBUG_MODULE "HelloDeck"
#include "debug.h"
 
#include "deck.h"
 
 
static void helloInit()
{
  DEBUG_PRINT("Hello Crazyflie 2.0 deck world!\n");
}
 
static bool helloTest()
{
  DEBUG_PRINT("Hello test passed!\n");
  return true;
}
 
static const DeckDriver helloDriver = {
  .name = "myHello",
  .init = helloInit,
  .test = helloTest,
};
 
DECK_DRIVER(helloDriver);
doc/crazyflie/api/firmware/deck/howto.1449670391.txt.gz · Last modified: 2015-12-09 15:13 by arnaud