lalla
This commit is contained in:
29
IR-capture-KBSim/src/main.cpp
Normal file
29
IR-capture-KBSim/src/main.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
int irPin=5;
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(irPin,INPUT);
|
||||
pinMode(1,OUTPUT);
|
||||
//Serial.begin(9600);
|
||||
digitalWrite(1,HIGH);
|
||||
//Serial.println("You pressed a button");
|
||||
delay(1000);
|
||||
digitalWrite(1,LOW);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
if(pulseIn(irPin,LOW))
|
||||
{
|
||||
//button pressed
|
||||
delay(100);
|
||||
digitalWrite(1,HIGH);
|
||||
//Serial.println("You pressed a button");
|
||||
delay(1000);
|
||||
digitalWrite(1,LOW);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user