From ba216919262d7f888bfb99debf81babe1ce88e0e Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 26 Aug 2017 20:33:02 +0200 Subject: Move lessons to doc --- .../infrared_Blink/infrared_Blink.ino | 35 ---------------------- 1 file changed, 35 deletions(-) delete mode 100755 Lesson 3 Infrared Remote Control Car/infrared_Blink/infrared_Blink.ino (limited to 'Lesson 3 Infrared Remote Control Car/infrared_Blink') diff --git a/Lesson 3 Infrared Remote Control Car/infrared_Blink/infrared_Blink.ino b/Lesson 3 Infrared Remote Control Car/infrared_Blink/infrared_Blink.ino deleted file mode 100755 index 59560e7..0000000 --- a/Lesson 3 Infrared Remote Control Car/infrared_Blink/infrared_Blink.ino +++ /dev/null @@ -1,35 +0,0 @@ -//www.elegoo.com -//2016.09.12 - -#include //Infrared Library -int receiverpin = 12;//Infrared signal receiving pin -int LED=13; //define LED pin -volatile int state = LOW; //define default input mode -unsigned long RED; -#define L 16738455 -IRrecv irrecv(receiverpin);//initialization -decode_results results;//Define structure type -void setup() { -pinMode(LED, OUTPUT); //initialize LED as an output -Serial.begin(9600); // debug output at 9600 baud - irrecv.enableIRIn();// Start receiving -} -void stateChange() -{ - state = !state; - digitalWrite(LED, state); -} -void loop() { -if (irrecv.decode(&results)) - { - RED=results.value; - Serial.println(RED); - irrecv.resume(); // Receive the next value - delay(150); - if(RED==L) - { - stateChange(); - } - } - } - -- cgit v1.2.3