Does anyone have a link to a page that describes well the use of variables and data types in arduino code?
Yes I know arduino.cc has links to Data Types, but it doesn't go in dept on what each can and can't do.
I am asking this because I am having a very hard time getting the right one to work. I have been swapping between char, word, floats, string, arrays, and sprintf's. They all act different, and don't seam to work well together.
To me it seams they can all do the same thing, yet no they can't, except when they want to, but only if they are suppose to.
For example. sprintf(templog_filename, "tp%02d%02d%02d.txt", year, month, monthDay ); builds a tp161001.txt string.
But later when I want to use that string, say to make
char file_name = templog_filename. I get errors
But if I define "char file_name[13];" at the begining of the code, I get different errors.
I only got it to work when I wrote the following:
sprintf(file_name, templog_filename);
Yet in other parts of my code. I have a byte "byte LEDpowerStatus = 0;" that I can easily change to another varible using:
void LED_power_loop(byte StatusChange) { /// called from LEDpowerStatus(1);
LEDpowerStatus = StatusChange;
}
Why does that work, yet the other does not.
For the second part of my code, I wanted to define "file_folder' but all the following fails and create errors.
file_folder = ("cwd temperature");
file_folder = "cwd temperature";
It is going to change depending on what director needs to be accessed. So I tried to define it in the beginning, but all the following fail:
char file_folder;
char file_folder;
char file_folder[16];
My various arduino projects are web page, and readable log files. And I need to use characters (ABCDEFGHI...) and sometimes with numbers, that have been combined together. My code is all over the place because CHAR works sometimes in certain areas, if not, I need to use sprintf's that I can't convert.
Can anyone lend some light on better explaining what everything does. Arduino.cc only sorta tells you what something is. Not what it can and can't do. And google results are all over the place and usually to one specific line of code.