Wireless differential steering creates another problem
I finally succeeded in controlling my bot project with a joystick. I'm using two Propellers and two nrf24L01 tranceiver ic's. It took a couple of months to get it done.
My next test will be to turn an LED on/off with a button. I want to send a binary "32" (LED pointer) and a "1" or a "0" (on/off). This represents one line of code in Spin. Maybe the solution is simple but I'm stuck. (There are some brilliant roboticists in this forum so it doesn't hurt to ask for help)
The problem is that differential steering requires five (byte) data packets while everything else I want to do only needs one byte packet.
IOW, when I transmit "%0001_0000" it accomplishes several things: It says "motors", it aligns the incoming data with a variable array and it clears the "idx" variable. Dropped packets were a problem.
My next test will be to turn an LED on/off with a button. I want to send a binary "32" (LED pointer) and a "1" or a "0" (on/off). This represents one line of code in Spin. Maybe the solution is simple but I'm stuck. (There are some brilliant roboticists in this forum so it doesn't hurt to ask for help)
The problem is that differential steering requires five (byte) data packets while everything else I want to do only needs one byte packet.
IOW, when I transmit "%0001_0000" it accomplishes several things: It says "motors", it aligns the incoming data with a variable array and it clears the "idx" variable. Dropped packets were a problem.
Comments
I think you've jumped from Step 1 to Step 14, without filling in the rest (or maybe your post requires following another thread?). Why does differential steering require five (byte) data packets? You can do it in half a byte, depending on the features you want.
I take it the purpose of the exercise to reduce the bytes required to indicate motor control is because you're losing data somehow, and you want to simplify the stream. So you want to control everything with one byte. If so, could you be more specific how you're mapping the bits in the byte you are sending, and what you are expecting to control in the motors other than direction.
I use two i/o pins per wheel with pwm to control speed, direction, turn and rotate.
I eventually want to add pan/tilt and an arm with a gripper. I got the idea from "vanmunch". I've wanted to build something like it ever since.
Having taken a fresh look at the code snippet below I'm going to test if CurrentSpeed == 32.
A fun and challenging project, highly recommended to teach patience. I did learn that the quality those cheap radio modules varies wildly, a third don't work at all, and from individually testing 3 different sets I could get one good pair with acceptable range, one mediocre range and one DOA.
Another fun fact (pay attention Publison!) is that I'm using analog joysticks with pots & ADCs. I tried the ones I mentioned recently and found that they are non-linear, most sensitive midrange and not sensitive near the endpoints. I found others I like better. In this case, I got what I paid for.
The video below shows my setup which does not use the radio or pot yet. I got sidetracked testing audio through the fixed-tone buzzer.
Duane Degn wrote an object than allowed you to put both chips on one Propeller. That made it easy as cake. Now I plug my 2nd board into my wife's desktop.
It is "...twice the work" but it's also "twice" the payoff too.
Duly noted, I'm still getting the Diptrace footprint finalize for the original joysticks. Many irons in the fire.