Crash Course Programming for Arduino: Difference between revisions

From Medien Wiki
 
Line 19: Line 19:
Variables can be typecasted (= converted from one datatype to another) by using the relevant functions: int(), long() or float().
Variables can be typecasted (= converted from one datatype to another) by using the relevant functions: int(), long() or float().


<source lang="c">
{{Template:Datatypes}}
void 0 bytes, 0bit, 0
boolean 1 byte, 1 bit, 0/1
char 1 byte, 8 bit, -128..127
byte 1 bytes, 8 bit, 0..255
int 2 bytes, 16 bit, -32768..32767
unsigned int 2 bytes, 16 bit, 0..65535
long 4 bytes, 32 bit, -2147483648..2147483647
unsigned long 4 bytes, 32 bit, 0..4294967295
float 4 bytes, 32 bit -3.4028235E+38..3.4028235E+38
double 4 bytes, 32 bit
array
String
...
</source>


== Variables ==
== Variables ==