Custom Deck to Use Arduino I2C Slave? #567
Replies: 1 comment
-
Hi, First of all I think your approach is good: the I2C bus on the Crazyflie is always active and so using it does not limit you from using any other deck in parallel. We are taking the same approach whenever it makes sense. For a 'simple' example of an I2C deck driver you can look at the active marker deck. This is a very similar design: the active marker deck has a small micro-controller talking over I2C to the Crazyflie. It exposes the same protocol as an i2c memory so that we can use read and write I2C function to talk to it reading and writing registers. You could just add your code in the Crazyflie firmware source tree to try it quickly, but the better way would be to build your make driver Out Of Tree. All you have to do is to compile the C file and the deck driver will be detected and usable in the Crazyflie, the deck driver is registered using the DECK_DRIVER() macro. More information about deck drivers and how to force initialization on one are in the documentation: https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/development/howto/ |
Beta Was this translation helpful? Give feedback.
-
Hello,
I would like to be able to control an arduino nano as an I2C slave from a crazyflie. I think I understand the electrical side, but I'm not sure how this would work in software. Firstly, would it be best for me to make a deck driver that then communicates with the arduino or is there a better way? Secondly, what does the process look like for sending/receiving i2c data from the crazyflie? For reference, I would like to use the arduino as a way to nicely control servos and only need one i2c line between it and the crazyflie. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions