]> kolegite.com Git - vmks.git/commitdiff
Renamed new files
authorVladimir Garistov <vl.garistov@gmail.com>
Sat, 24 Oct 2020 22:00:51 +0000 (22:00 +0000)
committerVladimir Garistov <vl.garistov@gmail.com>
Sat, 24 Oct 2020 22:00:51 +0000 (22:00 +0000)
LED_strip_2/LED_strip_2.ino [deleted file]
LED_strip_2/LED_strip_2.png [deleted file]
external_interrupt/external_interrupt.ino [new file with mode: 0644]
external_interrupt/external_interrupt.png [new file with mode: 0644]

diff --git a/LED_strip_2/LED_strip_2.ino b/LED_strip_2/LED_strip_2.ino
deleted file mode 100644 (file)
index 77ba930..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#define BTN_PIN        2
-#define LED_PIN        13
-
-void button_pressed_ISR(void);
-void slow_computation(void);
-
-volatile uint8_t led_state = 0;
-
-void setup()
-{
-       pinMode(BTN_PIN, INPUT_PULLUP);
-       pinMode(LED_PIN, OUTPUT);
-       attachInterrupt(digitalPinToInterrupt(BTN_PIN), button_pressed_ISR, FALLING);
-  
-       Serial.begin(9600);
-}
-
-void loop()
-{
-       slow_computation();
-       
-       if (led_state)
-       Serial.println("LED in on.");
-       else
-       Serial.println("LED in off.");
-}
-
-void button_pressed_ISR(void)
-{
-       if (led_state)
-       {
-       led_state = 0;
-       digitalWrite(LED_PIN, LOW);
-       }
-       else
-    {
-       led_state = 1;
-       digitalWrite(LED_PIN, HIGH);
-    }
-}
-
-void slow_computation(void)
-{
-       delay(5000);
-}
\ No newline at end of file
diff --git a/LED_strip_2/LED_strip_2.png b/LED_strip_2/LED_strip_2.png
deleted file mode 100644 (file)
index 2d29e5c..0000000
Binary files a/LED_strip_2/LED_strip_2.png and /dev/null differ
diff --git a/external_interrupt/external_interrupt.ino b/external_interrupt/external_interrupt.ino
new file mode 100644 (file)
index 0000000..77ba930
--- /dev/null
@@ -0,0 +1,45 @@
+#define BTN_PIN        2
+#define LED_PIN        13
+
+void button_pressed_ISR(void);
+void slow_computation(void);
+
+volatile uint8_t led_state = 0;
+
+void setup()
+{
+       pinMode(BTN_PIN, INPUT_PULLUP);
+       pinMode(LED_PIN, OUTPUT);
+       attachInterrupt(digitalPinToInterrupt(BTN_PIN), button_pressed_ISR, FALLING);
+  
+       Serial.begin(9600);
+}
+
+void loop()
+{
+       slow_computation();
+       
+       if (led_state)
+       Serial.println("LED in on.");
+       else
+       Serial.println("LED in off.");
+}
+
+void button_pressed_ISR(void)
+{
+       if (led_state)
+       {
+       led_state = 0;
+       digitalWrite(LED_PIN, LOW);
+       }
+       else
+    {
+       led_state = 1;
+       digitalWrite(LED_PIN, HIGH);
+    }
+}
+
+void slow_computation(void)
+{
+       delay(5000);
+}
\ No newline at end of file
diff --git a/external_interrupt/external_interrupt.png b/external_interrupt/external_interrupt.png
new file mode 100644 (file)
index 0000000..2d29e5c
Binary files /dev/null and b/external_interrupt/external_interrupt.png differ