LM2917 Dip8 (Frequency to voltage converter)

LM2917 Dip8 (Frequency to voltage converter)
int sensorPin = A0; int ledPin = 3; int sensorValue = 0; int maxv = 0; void setup() { pinMode(ledPin, OUTPUT); Serial.begin(9600); } void loop() { sensorValue = analogRead(sensorPin); if (sensorValue > maxv) { maxv = sensorValue; } int mapv = map(sensorValue, 3, maxv, 0, 255); Serial.print("maxv: "); Serial.print(maxv); Serial.print(", map: "); Serial.print(mapv); Serial.print(", sensorValue: "); Serial.print(sensorValue); Serial.println(); analogWrite(ledPin , mapv>0?mapv:0); }