Yes, just like we did for the Lambda Shield.Is it possible to implement an analog output for the Knock Shield?
![Image](http://support.bylund-automotive.com/analog_output/prototype.png)
Here is how to connect the RC-filter to the Arduino.
![Image](http://support.bylund-automotive.com/analog_output/schematics.png)
This is the RC-filter used in the example.
To enable the output first we need to define the pin to be used.
Code: Select all
#define ANALOG_OUTPUT_PIN 3 /* Pin used for the PWM to the 0-1V analog output. */
Code: Select all
uint8_t analogOutput = map(adcValue_UA, 0, 1023, 0, 255);
analogWrite(ANALOG_OUTPUT_PIN, analogOutput);
![Image](http://support.bylund-automotive.com/analog_output/signal.png)
The RC-filtered signal (blue) and unfiltered PWM signal (red).
Download the updated example code from GitHub.