Hi, I reviewed the serial tutorial. I am sending IR from a transmitter,
LEFT, RIGHT, FORWARD and REVERSE commands. At the RX side I need to parse these into case statements (or is there a better way) to set the duty cycle of 2 separate PWM channels.
Logic combination:
Forward
Reverse
Forward + right
Forward +left
Reverse + right
Reverse + left
Stop
If I set up the code with < FWD REV RIGHT LEFT >, that is 6 bytes. Since IR is slow it can take up to 50ms (rough calc, not sure if this is correct). This is too long to grab an entire frame then sort through it via logic. Would it be less laggy if I delt with each byte as it came in. Knowing that the byte length is fixed at < 4bytes > , or 6 total in terms of time consumed sending.
makes little sense to me. Do you control what the IR device is sending? Are you receiving single characters for each, plus prefix and suffix characters? It's not clear.
I was going to send 0-255 values from each of the bytes I am sending corresponding to
FWD, REV, Right and Left. Seems impractical once I calculated out the latency. This is for a two motor vehicle. I think the better way is to update hardcoded PWM at the vehicle since the TX is sending button presses. I just didn't want to tear the vehicle apart to get to the USB jack.