From 9843c52ec4fff920496dd04e47f8f823eff4c4ef Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Mon, 28 Mar 2022 19:14:12 +0000
Subject: [PATCH] Added debug receiver code and added pull ups to transmitter. Everything seems to be working

---
 firmware/debug_receiver/receiver/receiver.ino  |   35 +++++++++++++++++++++++++++++++++++
 firmware/trigger_firmware/trigger_firmware.ino |    3 ++-
 2 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/firmware/debug_receiver/receiver/receiver.ino b/firmware/debug_receiver/receiver/receiver.ino
new file mode 100644
index 0000000..478a842
--- /dev/null
+++ b/firmware/debug_receiver/receiver/receiver.ino
@@ -0,0 +1,35 @@
+#include <RF24_config.h>
+#include <nRF24L01.h>
+#include <RF24.h>
+#include <printf.h>
+
+RF24 radio(22, 21); // CE, CSN
+const byte address[6] = {'R','E','C','V', '1'};
+char val[4];
+
+void setup() {
+  // put your setup code here, to run once:
+
+  Serial.begin(115200);
+  radio.begin();
+  radio.openReadingPipe(0, address);
+  radio.setPALevel(RF24_PA_MIN);
+  radio.startListening();
+
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+
+  delay(5);
+  radio.startListening();
+  if ( radio.available()) {
+    while (radio.available()) {
+
+      radio.read(&val, sizeof(val));
+      Serial.print("Received = ");
+      Serial.println(val);
+    }
+  }
+
+}
diff --git a/firmware/trigger_firmware/trigger_firmware.ino b/firmware/trigger_firmware/trigger_firmware.ino
index 26b41b3..ff8993a 100644
--- a/firmware/trigger_firmware/trigger_firmware.ino
+++ b/firmware/trigger_firmware/trigger_firmware.ino
@@ -49,5 +49,6 @@
 
 void loop() {
   // put your main code here, to run repeatedly:
-
+//radio.write( &dataToSend, sizeof(dataToSend) );
+//    delay(5000);
 }

--
Gitblit v1.9.3