That’s a good idea, and I think it could work. The only problem would be identifying what ids are already taken and making sure they don’t choose the same one.
If there is a way to do that efficiently, then that way might work. When a transmitter or receiver is turned on, its id is 0. A transmitter that turns on identifies ids that are already in use, and picks one that is not. It then sends out a signal with a current id (0 still) and its desired id (whatever is not taken). It continues to do this until it receives a response from a receiver. When a receiver is turned on, it waits for a signal with a current id of 0 (like stated above) and a desired id. When it gets that signal, it sends an “acceptance” signal to the transmitter with id 0 and a desired id of whatever. The transmitter and receiver both become assigned to that id and will remain that way until one is shut down.
So basically, the transmitter sends a signal saying it is ready for a receiver and has picked out a unique id, and a receiver responds saying it will now “attach” to the transmitter. The reciever assigns itself to that id, and when the transmitter receives the acceptance signal, it does the same.
A problem would be if either the transmitter or receiver was turned off or lost power for some reason. Since the 24L01 doesn’t store any settings, everything would be reset. This would mean the link would be broken and could only be reestablished by turning on the transmitter and receiver again and going through the same process. There might be a way to still make it work, like if the transmitter stops getting acknowledgements it resets itself and similar for the receiver, but it might not work that well.
It is a good idea, but it could get to be a mess and could be difficult to manage.
I’m thinking that a user selected channel would work the best. The only problem would be if that channel has interference from something other than the modules for RC, like Bluetooth or something (for example), we would have the same problem as before. If the transmitter could get one packet through to the receiver saying to change the channel, it might not be a problem. I guess if there is too much interference on that channel, the car wouldn’t work right and the user would select another channel.
I guess permanent but unique ids would be the best way for the user but the worst way for the programmer/designer. I would really like it to be automatic so the user doesn’t have to worry about anything, but that could be very difficult. I will probably go with user selected channel switching, my only problem is figuring out a cheap, easy way to show the selected channel. I can’t use LCD screens because 1) I don’t have any experience with them and 2) that could get expensive and take up a lot of space, etc. One way would be a combination of LEDs that show a combination of different colors depending on the channel, but I would like to aboid that if possible. Plus, the more channels there are to choose from, the more LEDs I would have to have.
If only there was an easy way…