HI,
I'm trying to get something working with the LowLatencyLogger. I want to record one analogue value and 4 digital values.
Since the Aruduino Due I'm using has a 12 bit A2D is it possible to use the upper 4 bits of the 16bit variable in the data struct to store the discreets?
Something like this in UserTypes.h
struct data_t {
uint32_t time;
uint16_t adc;
};
and this in the acquiredData ()?
// Acquire a data record.
void acquireData(data_t* data) {
uint16_t tempword = analogRead(0);
tempword |= digitalRead(PinA) << 15;
tempword |= digitalRead(PinB) << 14;
tempword |= digitalRead(PinC) << 13;
tempword |= digitalRead(PinD) << 12;
data->time = micros();
data->adc = tempword;
}