Quick background - im a communications engineer, so understand all the electronics, but im a hopeless programmer! So please bear with me,
Im working on a project that requires bidirectional serial data transfer between two Arduinos (in this case a nano and a mega). Im not going to start as complex as that though, and for now just need to get my head around transferring data from one of them to the other,
Now, the data in question is in the form of individual binary inputs but needs to be displayed as the decimal equivalent. Its not strictly binary though, as it comes from groups of four or five switch contacts in a 'sort' of BCD. Each switch represents one unit of a radio frequency, i.e. one switch will be the kHz value, another the 10KHz etc etc,
At the other arduino, or to start with on the serial monitor i guess, I need to display the actual decimal value, of all the switches, in order, to show the actual frequency,
as an example, imagine that the frequency 123.4kHz has the binary equivalent of 1111 1111 11111 111
you get the idea...
What im not at all sure about is how the data is transferred by a serial link. As I understand it, it is done one byte at a time? So am I right in thinking that I will need to do the conversion of the bianry to decimal before sending the values over the link, as decimal values?
So, for example - I would read the four input pins that connect to say, the nkHz switch, convert that to the decimal equivalent, then send that number by serial? Or do I read and convert all the switches until I have the whole set of decimal values for the full frequency, and send them all together as a large integer?
The goal here is to read all the frequency setting switches (there are 6 of them!), send the value to the other arduino, and display the decimal frequency on an LCD (which will be somewhere between 2,000.0MHz and 29,999.9MHz). This will create a frequency display remote to the radio that the switches are on.
I intend to start learning how to do this by setting up one Arduino with a set of DIP switches to mimic the radios frequency switches (just one at first) and get that sending data to the serial monitor, then move up to mimicing the whole switch bank and displaying the full frequency (around 19 inputs!), from there move to displaying on the LCD of the other arduino.
So any advice anyone can give on getting the first stage working would be very helpful!