Write led sequence to mem api

Firmware/software/electronics/mechanics
Post Reply
alienado
Beginner
Posts: 8
Joined: Wed Nov 04, 2020 1:00 am

Write led sequence to mem api

Post by alienado »

Hi guys,
I managed to work Crazyflie and the lighthouse base station, creating autonomous flights with a great stability.

Our Crazyflies have also a led-ring deck, using the drones memory I was able to create a led sequence but I was unable to write this mem to the drone (Via mem[0].write_data(self._upload_done)).

Maybe it's my mistake, but I'm having difficulty to find documentation about working with memory api. I would like your help in understanding how can I write a led sequence to the drone and, when starting with trajectory, how can I send start the led sequence?

Thanks.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Write led sequence to mem api

Post by kimberly »

This is quite new functionality so there is probably not a lot known about the memory from the python library point of view, but there is some documentation available for CRTP: https://www.bitcraze.io/documentation/r ... /crtp_mem/

We have examples for the LED sequence mem api: https://github.com/bitcraze/crazyflie-l ... memSync.py

Is this something you already found before? Let us know if you need more guidance
alienado
Beginner
Posts: 8
Joined: Wed Nov 04, 2020 1:00 am

Re: Write led sequence to mem api

Post by alienado »

Yes I found it before and thanks for share it.

Nevertheless, I have some doubts regarding this:
- when using the example scripts, the mem sequence ends with mem[0].write_data(None), I supposed anything was written to the memory
- in other hand, when uploading the trajectories to CF and following the examples, trajectory_mem.write_data(self._upload_done) is written like that

My doubts were about this, I tried to write the led sequence as trajectory but it didn't worked.
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Write led sequence to mem api

Post by kristoffer »

The

Code: Select all

None
in

Code: Select all

mem[0].write_data(None)
just means that no callback is registered to tell you that the write was actually successful. In the trajectory example we did add a callback (_upload_done()) if you want to check out how to do that.
Post Reply