Re: Adding Analog Sensor to Crazyflie 2.0
Posted: Tue Jul 21, 2015 11:57 pm
Hi,
I have created a pull request (hopefully in the correct way):
https://github.com/bitcraze/crazyflie-f ... l/57/files
It contains the following updates:
* Contains only the deck API parts
* NOTE: Now using ADC2 instead of ADC1. This since ADC1 has temp and vref internally wired to it, so a more optimized use of ADC1 at a later stage may be relevant. If you prefer to use ADC1 for the "arduino-style" calls instead, please let me know.
* gpioMapping struct is now placed in deck_constants.c, with a typedef and external declaration in deck_constants.h
* gpioMapping was renamed deckGPIOMapping, since it is now part of an API exposed to the rest of the code base, thus prefixing with "deck". Hope this is OK.
* adcMapping was merged into deckGPIOMapping
* the DECK_PIN_XX definitions were moved to deck_constants.h, and renamed DECK_GPIO_XX for consistency.
* Some minor cleanups.
I have created a pull request (hopefully in the correct way):
https://github.com/bitcraze/crazyflie-f ... l/57/files
It contains the following updates:
* Contains only the deck API parts
* NOTE: Now using ADC2 instead of ADC1. This since ADC1 has temp and vref internally wired to it, so a more optimized use of ADC1 at a later stage may be relevant. If you prefer to use ADC1 for the "arduino-style" calls instead, please let me know.
* gpioMapping struct is now placed in deck_constants.c, with a typedef and external declaration in deck_constants.h
* gpioMapping was renamed deckGPIOMapping, since it is now part of an API exposed to the rest of the code base, thus prefixing with "deck". Hope this is OK.
* adcMapping was merged into deckGPIOMapping
* the DECK_PIN_XX definitions were moved to deck_constants.h, and renamed DECK_GPIO_XX for consistency.
* Some minor cleanups.
Yup, agree completely, that was just a dirty hack to test the deck_analog API and the sensor, it was not meant for merging it its current state. I have removed all the MaxBotix related code and dirty hacks from the pull request.The only comment I have is that the connection to the stabiliser loop: it is a bit intrusive. We will need at least an #ifdef to merge it. Anyway this is a problem we have had since the begining and we will need to find a way to make internal connection a bit more modular (maybe something like allowing deck driver to feed an altitude and the stabilizer to use the best available altitude source)