From c6fcd536db5bbf0c318dddf06f9bf4c1c65c10f4 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Sat, 26 Mar 2022 21:39:59 +0000
Subject: [PATCH] First simple interrupt firmware

---
 firmware/trigger_firmware/trigger_firmware.ino |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/firmware/trigger_firmware/trigger_firmware.ino b/firmware/trigger_firmware/trigger_firmware.ino
new file mode 100644
index 0000000..a76cd54
--- /dev/null
+++ b/firmware/trigger_firmware/trigger_firmware.ino
@@ -0,0 +1,28 @@
+#include<WiFi.h>
+
+#define IN_TRIGGER 18
+#define OUT_TRIGGER 19
+
+
+void IRAM_ATTR isr() {
+    digitalWrite(OUT_TRIGGER, HIGH);
+    delay(1);
+    digitalWrite(OUT_TRIGGER,LOW);
+}
+
+void setup() {
+  // put your setup code here, to run once:
+  
+  WiFi.mode(WIFI_OFF);
+  btStop();
+
+  pinMode(IN_TRIGGER, INPUT_PULLUP);
+  pinMode(OUT_TRIGGER, OUTPUT);
+  attachInterrupt(IN_TRIGGER, isr, RISING);
+
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+
+}

--
Gitblit v1.9.3