Hallo
When I am compiling this program I have two errors, can someone help me to fix them ?
Those two lines are causing the error
the error with one line disabled
C:\Users\OWNER\Documents\Arduino\mk_example_3\mk_example_3.ino: In function 'void setup()':
mk_example_3:12: error: 'analogWriteResolution' was not declared in this scope
analogWriteResolution(12); // max resolution on the output
^
exit status 1
'analogWriteResolution' was not declared in this scope
When I am compiling this program I have two errors, can someone help me to fix them ?
HTML:
#define NZEROS 1
#define NPOLES 1
#define GAIN 1.324919696e+00
static float xv[NZEROS+1], yv[NPOLES+1];
int sampleRate=50000;
//elapsedMicros microCount;
int microsPerSample =1000000/sampleRate;
void setup()
{
analogWriteResolution(12); // max resolution on the output
analogReadResolution(12); // same on input
}
int myOutput=2048;
void loop()
{
// analogWrite(A14,myOutput);
float myInput= analogRead(A0) - 2048; //512=10 bit DC level adjust! 12 bit = 2048
xv[0] = xv[1];
xv[1] = myInput / GAIN;
yv[0] = yv[1];
yv[1] = (xv[0] + xv[1])+ ( -0.5095254495 * yv[0]); //coefficient is here...
myOutput = 2048 + int(yv[1]); //dc offset + output filter
// while(microCount<microsPerSample){} // fill our timing budget
// microCount-=microsPerSample; // keep pace
}
Those two lines are causing the error
HTML:
// analogWriteResolution(12); // max resolution on the output
// analogReadResolution(12); // same on input
the error with one line disabled
C:\Users\OWNER\Documents\Arduino\mk_example_3\mk_example_3.ino: In function 'void setup()':
mk_example_3:12: error: 'analogWriteResolution' was not declared in this scope
analogWriteResolution(12); // max resolution on the output
^
exit status 1
'analogWriteResolution' was not declared in this scope