Can anyone help me figure out why my sampling rate is so much slower than what it should be?? Right now, I'm topping out at 5k. I am using a lookup table to generate a sine wave and then outputting it using pin A6. Below is my code for reference. Thanks in advance.
---------------------------code-----------------------------------
int a[arraySize] = {2048,2305,2557,2802,3035,3252,3450,3626,
3777,3901,3996,4060,4092,4092,4060,3996,
3901,3777,3626,3450,3252,3035,2802,2557,
2305,2048,1791,1539,1294,1061,844,646,
470,319,195,100,36,4,4,36,
100,195,319,470,646,844,1061,1294,
1539,1791,2048};
void setup(void) {
Serial.begin(115200);
analogWriteResolution(12);
}
void loop(void) {
for (i = 0; i < arraySize; i++
analogWrite(A6, a[i]);
}