Any thought on why this is so slow? Can only get 514 Hz out of it with the .1 phase inc.
#define ARM_MATH_CM4
#include <arm_math.h>
float phase = 0.0;
float twopi = 3.14159 * 2;
float val = 0.0;
//elapsedMicros usec = 0;
void setup() {
analogWriteResolution(12);
}
void loop() {
val= arm_sin_f32(phase)*2000.0+2050.0;
analogWrite(A14, (int) val);
phase = phase + 0.1;
if (phase >= twopi) phase = 0.0;
#define ARM_MATH_CM4
#include <arm_math.h>
float phase = 0.0;
float twopi = 3.14159 * 2;
float val = 0.0;
//elapsedMicros usec = 0;
void setup() {
analogWriteResolution(12);
}
void loop() {
val= arm_sin_f32(phase)*2000.0+2050.0;
analogWrite(A14, (int) val);
phase = phase + 0.1;
if (phase >= twopi) phase = 0.0;