I am having trouble with the receiver on my project. Specifically, the code to check if a message was received never goes true. I tried uploading the receiver example code and it seemed to work, but I can't figure out what specifically is different (besides names or pin numbers). The following line of code is the specific issue I am having trouble with:
if (vw_get_message(buf, &buflen)) // if we receive a message
This line never goes true so my code never executes. I have attached the full code. flowerPotMonitor_receive.ino (2.4 KB)
Op has an example that works, similar to what he attached, yes, it would have been better to have it in the post with </> tags... but.
Op made a few changes. Code does not work. Eyeballing it Op cannot see the issue.
This is what text comparison tools do... compare two (hopefully similar) text files and color-highlight the changes. This is an educational opportunity to learn a new tool which will serve Op well over time. Catch that misplaced comma or semicolon!
As I stated earlier, I uploaded an example code to the circuit (with the pin number changes) and I was receiving data (as per the serial monitor) and the led. My code will not turn on the led since it is not getting past the if statement.
@mrburnette If you are referring to the tx and rx pins being the same number, they are on different Arduinos so that should not be an issue. I only added the tx pin and the ptt pin because they were in the example code. Otherwise I am not sure what you are referring to.
But its in the ONE code, so what is pin 12 tx or tx, it cannot be the same in the one code.
They should be different in each code.
(Have you forgotten to comment one of the lines out?)
In your code as it stands, rx is pin 12, same as in other code.......
No, please circuit diagrams please, not Fritzy images.
Draw and post images of your circuits, include power supply, component labels and pin names.
@TomGeorge I have attached the circuit diagrams. They are just pinouts (hopefully that is good enough for you; I don't have the Arduino Library for my Schematic Editor).