mirror of
https://github.com/digistump/DigistumpArduino.git
synced 2025-11-03 13:04:48 -08:00
switch to setup for Arduino Boards Manager
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
int irPin=11;
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(irPin,INPUT);
|
||||
pinMode(13,OUTPUT);
|
||||
Serial.begin(9600);
|
||||
digitalWrite(13,HIGH);
|
||||
Serial.println("You pressed a button");
|
||||
delay(1000);
|
||||
digitalWrite(13,LOW);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
if(pulseIn(irPin,LOW))
|
||||
{
|
||||
//button pressed
|
||||
delay(100);
|
||||
digitalWrite(13,HIGH);
|
||||
Serial.println("You pressed a button");
|
||||
delay(1000);
|
||||
digitalWrite(13,LOW);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user