int analogPin = 15, RELAY_PIN = 18;
int inputValue = 0, outputValue = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
inputValue = analogRead(analogPin);
Serial.print("input value : ");
Serial.println(inputValue);
outputValue = map(inputValue, 0, 1023, 0,255);
Serial.print("Output Value : ");
Serial.println(outputValue);
//analogWrite(ledPin,outputValue);
analogWrite(RELAY_PIN ,outputValue);
delay(1000);
// this speeds up the simulation
}