This is great, thanks for your help!
As I said before I am new to programming, so I have som work to do to understand all this, and I maybe will ask some unusual questions which are "unususal" (because obvious for experienced programmers). So I guess it may be either annoying or exhilarating
So where to start...
Perhaps the easiest baics, data types, summary from Arduino.cc - learning - references
- char - holds 1byte / 8bit - signed and unsigned
- byte - holds 1byte / 8bit - unsigned
- int- holds 2byte / 16bit - signed and unsigned
- long- holds 4byte / 32bits - signed and unsigned
- word- holds 2byte / 16bits - unsigned
- short- holds 2byte / 16bits - signed
- float - holds 4byte / 32bits - 3.4028235E+38 to 3.4028235E+38
where
- 1 byte = 8bit, unsignded = 0 to 255 (decimal) (0 to 2^8-1
- 1 byte = 8bit, signded = -128 to 127 (decimal)
- 2 byte = 16bit, unsignded = 0 to 65535 (decimal) (0 to 2^16-1
- 2 byte = 16bit, signded = -32 768 to 32767 (decimal)
- 4 byte = 32bit, unsignded = 0 to 4 294 967 295 (decimal) (0 to 2^32-1
- 4 byte = 32bit, signded = -2 147 438 648 to 2 147 483 647 (decimal)
I understand that
- unsigned char & byte
- signed int & short
- unsigned int & word
in priciple are the same data type?
As I have seen it is very comon to declare variables for pins as an int, but from the point of memory usage it would be better to:
//common wayÂ
int pinLED = 13;
pinMode (pinLED, OUTPUT);
//to spare memory space??
byte pinLED = 13;
pinMode (pinLED, OUTPUT);
...or is there something else I haven not thought about which make that not work?
Thanks gpopl for taking time to help me with that piece of code. For me it is dificult to understand the controlBlink function, but I really try hard...I guess I will come back with some questions later :