Trim Parameter Packets

Firmware/software/electronics/mechanics
Post Reply
Johannes
Beginner
Posts: 3
Joined: Mon Jul 20, 2015 2:58 pm

Trim Parameter Packets

Post by Johannes »

My plan is to set the trim parameters on my CF2 from an iPhone app. I've seen someone set the altHold parameter (packet shown below) but I don't understand how to generate the packets to send trim parameter updates.

Code: Select all

struct __attribute__((packed)) {
            uint8_t header;
            uint8_t ident;
            uint8_t val;
        } altHoldPacket;
        
        NSData *myData;
        altHoldPacket.header = ((0x02 & 0x0f) << 4 | 3 << 2 |(2 & 0x03));
        altHoldPacket.ident = 11;
        altHoldPacket.val = 1;
I tried searching the forum and google but I could not find out how a trim parameter packet looks like.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Trim Parameter Packets

Post by arnaud »

Hi,

There is no timing parameter in Crazyflie.

The trim parameters on the PC client are used on the client side (the pitch and roll are corrected before being sent to the Crazyflie).

If you want to write the new trim parameters in the Crazyflie 2 EEPROM memory you will have to use the memory packets: https://wiki.bitcraze.io/doc:crazyflie:crtp:mem to write the new configuration in the eeprom (the format can be found there: https://github.com/bitcraze/crazyflie-f ... prom.c#L61).
Post Reply