I once added one variable to a C# program configuration and had to add 150 lines of validation (about 30 checks, including telling the user that there were mistakes); you're warned
Well, I was saved from that experience by one line of code (that I got from your post, post #15):
float frequency = atof(receivedChars);
This created a float called frequency, and computed recievedChars into the float! From there I just printed frequency to the module!
I can't say how much I appreciate all the help on this topic. With that being said, I have a new issue with this project, related to this topic. (Que: slow, sarcastic applause from other forum posters)
Here is the new issue. (In the same project, different "area" of the project.)
I have an arduino mega, plugged into a TFT LCD, a radio module, and a good PS2 keyboard. (Sound familiar?) Now. An Arduino UNO is plugged into the Mega, communicating with two jumpers over Software Serial. Plugged in to the Arduino Uno, there is a GSM Phone module. Here is what I want to go down:
- The user enters a phone number on the PS2 keyboard
- The phone number is relayed to the uno through software serial
- The uno then tells the GSM module to voice call the phone number
Here are my thoughts. When the user starts up the program on the arduino mega, it sends "s" to the uno, priming it for data reception.
Idea #1. From there, each time the user enters a number on the keyboard, the number is printed to the TFT lcd, then printed to the Arduino uno. Then, the uno stores each incoming byte in a char array. The user hits enter, and "f" is printed to the Arduino Uno. This tells the uno to send the entire char array to the GSM module.
Idea #2. The user begins to type into the ps2 keyboard. Each thing is stored in a char array. When the user hits enter, the char array is sent to the UNO, where it is then sent to the GSM module. The only problem is, I have no idea how to receive a full char array over software serial, so how could I make the uno get the full char array and print it to the GSM module!
EDIT: Forgot this last part:
So which idea would be better?
Again, thanks for the wondrous help so far, it is really awesome!