Good afternoon,
I am trying to connect an Analog to Digital Converter (this one), so I’m using the driver of the libraries/AP_ADC folder.
To log the data, I created a function in the class Plane of Arduplane that simply reads from the ADC and send it to the ground control station. But now I don’t want it to send it in that method, I want to send it when it sends the rest of the data, so I wanted to create an attribute of the class Plane and store it there.
The problem I am having is that everytime I try to assign something to that attribute and I compile the code and install it on my Pixhawk, it doesn’t connect, and the amber light blinks at 4Hz (which according to pixhawk webpage that means that there’s no FMU input) and blue light blinks at 2Hz (which means that the heartbeat loop is running).
I declare my variable and functions as follows in the Plane.h file:
adc_report_s *report;
void adc_read ();
When I do it with a variable declared inside the function it works perfect, but as soon as I do something like: report = local_var; it doesn’t work. Also if I do: report = new adc_report_s[channel_number] also crashes.
I don’t know if this problem is ok in this category, if not you would help me a lot just by saying in which category I should post it.
Thanks in advance.