The idea is i send a raw analoflg value from a potentiometer to RX, and it acts accordingly to mapped servo values, running 4 brushless motors. The signal is excellent; the message goes through to rx. The only problem is i need CONSISTENT input coming from Tx.
But on tx, it is only sending once. I wrote some code where it prints the raw value on the Serial Monitor, then sends it via nRF.
I wouod have posted the code, but i only took pics of it. Laptop wireless card is busted, i have no eth cable. Ill see if i can send the pics i took of the code. I also dont have it on my phone.
The code you did post is silly. You call Serial.print() without calling Serial.begin(), and yet you expect us to believe that you got output somewhere. Not going to happen, until you post your REAL code.
Robin2:
I suspect I have given you the link to this Simple nRF24L01+ Tutorial in another Thread. Does the tutorial code work for you?
If not. get it working first. Then extend the project to do other stuff.
...R
That's exactly what i did! I made it a routine to use your code for any nRF projects.
But even changing the delay won't work for some reason! I don't know why it's not working. I have read over the code a bunch of times, but I cant find any errors
I did notice today that if i declared "data" as a global variable (ie, outside of loop) i get nothing printed.
You're referring to the SimpleTx and SimpleRx. I got those to work.
I make it a routine whenever dealing with nRF to use your tutorial.
I tried to add the reading of the analog values in loop(). But then it doesnt work. Sometimes, it doesn't even check the value of the analog pin. It will consistently do it only when I remove the radio.write(). I also tried switching the order in which they happen, where it prints the value first, then sends it. Then when that didn't work, I'd send it then print the value.
If the problem only occurs when you read the analog pin, then it is very unlikely to be a software problem.
On the transmitter, comment out the radio.write() call. Just read the analog pin and print the value. Do you get more than one value printed? If not, there is something wrong with your hardware.