Thanks Again Felix!Attached is new - Faster - code.Transmissions will take about 5-6ms at the very least (no payload). ACKs are like regular transmissions with no payload. So transmitting every 2ms is not feasible, ...
Right! I did some more reading and servos accept commands about 40 per second which is every 25ms. I was speaking from ignorance when I put out the idea to transmit every 2ms.
Have you considered using a digital pot?
Yes, and a digital servo. But not anymore. A very accurate fast response is not required. It just does need to be responsive.
Oh, and I chewed quite a wad here with getting the Moteinos and programming without also having to learn about digital pots. Remember you convinced me not to use another Arduino clone to interface but, to make it simpler?
You have a hard problem on your lap. You have to move a remote servo based on the turn of a pot somewhere else. I think the key is to be smart about sampling. You want to have as smooth motion as possible. You have to sample often, BUT transmit seldom (say at most a few dozen ms apart).
Servos only require commands about every 25ms. This makes your guesstimate of every few dozen of ms - 'Spot On.' for sending data.
'Sampling' is the term I needed to use in my earlier questions. Since a servo only needs commands every 20-25ms I should sample and transmit every 20-25ms. This would dramatically lower RF transmissions.
If the pot turns the other way while the servo is still moving to a given point, then quickly transmit a packet that will reverse it towards the latest position it should be in.
I LIKE IT!
Sampling the direction, every 10-12ms should work. IF direction changes THEN capture and transmit the new direction command and re-set the 20-25ms transmit cycle ELSE continue 25ms transmission cycle.
Another essential thing in such "streaming" scenarios is to avoid using ACKS which will effectively double the RF traffic. In a continuous streaming situation, where there's a lot of packets with new positions transmitted all the time, the loss of a packet is no big deal because a soon to come packet will have the latest position anyway.
Yep, got ya. I've removed ACKS from the example code I was using as a base for this project.
Also the frequency channel can be susceptible to interference, so shifting the center frequency up or down may help if you are experiencing a lot of RF interference (using setFrequency(32 bit value) with values from the datasheet).
Ah, I wondered about that. OK, if happens I will read datasheet and use.
Need to note too that there may be benefits from different antenna and filters. But, then that would become a sophisticated system.
I believe you found the other examples where I send data every X ms. I hope I answered your questions.
Yes, thank you. A lot of mysterious coding.
But, I am making sense of some.