I'm trying to make a 4 channel RC using Arduino and nrf24L01 module. I already know how to deal with this module, but the question is "What does 4 channel mean ?", and how to make it supports 4 channel ?
-
Sounds like a class assignment? You might need to ask your teacher what is expected :)Mikael Patel– Mikael Patel2016年07月21日 22:24:28 +00:00Commented Jul 21, 2016 at 22:24
1 Answer 1
4 channel means having the ability to send 4 individual values (maybe speeds?) at once.
Since the nRF24L01+ is a packet based system it is as simple as sending the different "channels" as different bytes (or groups of bytes if more than 0-255 or -128 to +127 is needed).
For instance, if you want 4 channels that can represent 0-255 then you need 4 bytes, and so you can set both sender and receiver to have a packet size of 4 bytes (for efficiency) and send a packet made up of the 4 channel values.
If you want to represent numbers bigger than that then you need to split the variable into bytes (two bytes for an int, 4 for a long) or create a struct
to represent your packet of data. Of course you then need the sender and receiver to be set to a packet size at least big enough to contain the data, and both ends must agree on the packet size.
-
'Channel' here probably refers to something like these RF module types: electronics-diy.com/store/4-Channel_RF_Remote_Control.jpg. More like 4 bits/states really and a lot more direct than the NRF24 and far below its capabilities; there's no direct translation, I think.SoreDakeNoKoto– SoreDakeNoKoto2016年07月22日 01:02:55 +00:00Commented Jul 22, 2016 at 1:02
-
@TisteAndii That then is just 4 values of a single bit resolution. It could be sent as the lower nibble of one byte in an nRF24L01+ packet. 'Channel' usually refers to one "pipe" of data values, such as in a radio control plane: pitch, yaw, roll, throttle (or tail flaps, tail fin, ailerons, engine). I suspect this is a (somewhat better) reposting of an earlier question that I cannot find now (probably closed and deleted) which was wanting to communicate with 4 channels for motor control or something. Or if not, the circumstances seem so similar as to make me think it's the same assignment.Majenko– Majenko2016年07月22日 09:39:38 +00:00Commented Jul 22, 2016 at 9:39
-
You're right. I guess I just thought buying this module only for sending 4 bits is a bit wasteful, unless its for the range. But since the capacity is already being wasted, they might as well use 1 reading pipe per bit at the receiver. Have the transmitter use the pipe 0 to write a bit (a byte, really) to each of the receiver's 4 reading pipes, to better sell the whole '4-channel nRF equivalent'.SoreDakeNoKoto– SoreDakeNoKoto2016年07月22日 13:26:49 +00:00Commented Jul 22, 2016 at 13:26
-
1The whole concept of "channels" only has any real meaning when talking about analog communications anyway. With digital it's all packets. "Channel" is used to indicate the precise frequency it operates on.Majenko– Majenko2016年07月22日 13:28:59 +00:00Commented Jul 22, 2016 at 13:28