below is my current dac write function, dac does the actual i2c communication and DACout calls dac for each of the 4 channels. I was looking at maybe using the IntervalTimer objects instead of trying to go full on audio library... really what I need is just to have the ability to prioritize my dac writes above my OLED screen writes. The reason I thought of the audio library was basically because it is capable of pretty darn good timing updates and may inherently schedule the dac writes above my OLED screen writes.
would going the IntervalTImer route possibly be a better option?
Ill find the dac part number in a moment, gotta pull apart the prototype to check.
Code:
void dac(byte channel, int value){
Wire.beginTransmission(B1100000);
Wire.write(B01000001|((channel%4)<<1));
Wire.write(B00000000|(value>>8));
Wire.write(value&255);
Wire.endTransmission();
}
void DACout(){
for(int numdacs = 0; numdacs < totalWaves; numdacs++){
dac(numdacs,wave[numdacs][wavePhase]);}
}