Devices & Components
Arduino Uno Rev3
IR Transceiver (Generic)
5 mm LED: Red
Capacitor 100 µF
Jumper wires (generic)
Project description
Code
Code
c_cpp
Here is the project code
1int analogInPin = A0; // Analog input pin that the potentiometer is attached to 2 3int led =10; 4int sensorValue = 0; // value read from the pot 5 6void setup() { 7 // initialize serial communications at 9600 bps: 8 Serial.begin(9600); 9 pinMode(led, OUTPUT); 10} 11 12void loop() { 13 // read the analog in value: 14 sensorValue = analogRead(analogInPin); 15 Serial.print("sensor = " ); 16 Serial.println(sensorValue); 17 18 delay(200); 19 20 if(sensorValue<80) 21 { 22 digitalWrite(led,HIGH); 23 } 24 else 25 { 26 digitalWrite(led,LOW); 27 } 28} 29
Documentation
Pin Diagram
Here project pin diagram
Pin Diagram

Pin Diagram
Here project pin diagram
Pin Diagram

Comments
Only logged in users can leave comments