Hi, I’m new to this software and Arduinos and programming so I was wondering if I could get some help.
Cesar published cesars/tfmini-lidar a while ago. I have a TF-Luna instead of the TFmini and it supposedly is a bit different.
I wrote this in the Arduino IDE software over the last few weeks. It checks if something is in front of the range finder and if it is, it will wait 3 seconds if it still detects in front of the range finder it will play a noise on the speaker. The purpose of this is to warn someone to move if they try parking in front of a radio antenna I have on a mountain top. The end goal is for it to check if there is someone In range. If it is in range, it will wait a bit in case they are just driving past. If they stop it will make a noise.
It has a few minor issues with it. It doesn’t always wait for new information to be sent to the serial log, and it will play the alarm as though the obstruction did not move. After playing the alarm once or twice more than it should, it goes back to normal. I want to make it more reliably reporting information. It seems like it doesn’t wait long enough for the information from the serial to update before it reads the most recent entry, which is sometimes the old entry still so it will just alarm again because of that, and then it will update and stop going off.
I was hoping I could move it to XOD so I could more easily troubleshoot the problem because I am not entirely sure what I’m doing and a visual language may help me.
Here is the code that is working for me right now in Arduino IDE:
This is the example that I’m working from: ArduinoAlarm/Range_Finder.ino at main · MrEndermen/ArduinoAlarm · GitHub
My issue here mainly is I am unsure how to import code directly into XOD, and unsure if that is even possible. I do see that there is a way to make complicated pieces of hardware from scratch by combining different things but I am in the dark on how to do it. I attempted to modify the existing tfmini but it seems to not like what I’m doing. I even tried using the default tfmini stuff that cesar created but it doesn’t seem to work either.
I also tried modifying the content of the “C++ implementation” inside the node by pasting some of my previous projects and the example into it but that seems to be the wrong thing to do.
I was wondering if anyone could help me with this. I am more than happy to put the effort in to learn this myself I just need some guidance as I’m a bit lost at this point and I feel like I’m grasping at straws by just pasting previously functioning work into this currently functioning work and I’m not sure how to move forward.
Any help is greatly appreciated. Thank you very much.