Devices & Components
Arduino Uno Rev3
IR module
Jumper wires (generic)
Software & Tools
Arduino IDE
Project description
Code
the code:
arduino
1#define IRpin 2 2#define ledPin 13 3void setup() { 4 // put your setup code here, to run once: 5pinMode(IRpin,INPUT); 6pinMode(ledPin,OUTPUT); 7} 8 9void loop() { 10 // put your main code here, to run repeatedly: 11 int IRread = digitalRead(IRpin); 12 digitalWrite(ledPin,LOW); 13if(IRread == 0){ 14 digitalWrite(ledPin,HIGH); 15} 16}
Downloadable files
circuit:
circuit:

circuit:
circuit:

Comments
Only logged in users can leave comments