Analog output for Knock Shield
Posted: 19 Dec 2019 00:45
Yes, just like we did for the Lambda Shield.Is it possible to implement an analog output for the Knock Shield?
Here is how to connect the RC-filter to the Arduino.
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);
The RC-filtered signal (blue) and unfiltered PWM signal (red).
Download the updated example code from GitHub.