intsensorPin=A0;// select the input pin for the potentiometer
intledPin=13;// select the pin for the LED
intsensorValue=0;// variable to store the value coming from the sensor
voidsetup(){Serial.begin(115200);// declare the ledPin as an OUTPUT:
pinMode(ledPin,OUTPUT);}voidloop(){// read the value from the sensor:
sensorValue=analogRead(sensorPin);Serial.println(sensorValue);// turn the ledPin on
digitalWrite(ledPin,HIGH);// stop the program for <sensorValue> milliseconds:
delay(sensorValue);// turn the ledPin off:
digitalWrite(ledPin,LOW);// stop the program for for <sensorValue> milliseconds:
delay(sensorValue);}
intsensorPin=A0;// select the input pin for the potentiometer
intlightSensorPin=2;// select the input pin for the potentiometer
intledPin=13;// select the pin for the LED
intsensorValue=0;// variable to store the value coming from the sensor
intlightSensorValue=0;// variable to store the value coming from the sensor
voidsetup(){Serial.begin(115200);// declare the ledPin as an OUTPUT:
pinMode(ledPin,OUTPUT);pinMode(lightSensorPin,INPUT);}voidloop(){// read the value from the sensor:
sensorValue=analogRead(sensorPin);lightSensorValue=digitalRead(lightSensorPin);Serial.print("Temp. Sensor:");Serial.print(sensorValue);Serial.print(" Light. Sensor:");Serial.println(lightSensorValue);// turn the ledPin on
digitalWrite(ledPin,HIGH);// stop the program for <sensorValue> milliseconds:
delay(sensorValue);// turn the ledPin off:
digitalWrite(ledPin,LOW);// stop the program for for <sensorValue> milliseconds:
delay(sensorValue);}