Page 1 of 1

Write led sequence to mem api

Posted: Mon Nov 09, 2020 8:26 pm
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.

Re: Write led sequence to mem api

Posted: Tue Nov 10, 2020 7:43 am
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

Re: Write led sequence to mem api

Posted: Tue Nov 10, 2020 11:38 am
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.

Re: Write led sequence to mem api

Posted: Wed Nov 11, 2020 9:06 am
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.