Class Bertl added
Dependencies: HCSR
Dependents: BERTL_ButtonLeds Bertl_Arbeit FollowLine SerialPC ... more
Fork of ur_Bertl by
You are viewing an older revision! See the latest version
Datentypen
Type | Keyword | Bytes | Range |
---|---|---|---|
character | char | 1 | -128 .. 127 |
unsigned character | unsigned char | 1 | 0 .. 255 |
integer | int | 2 | -32 768 .. 32 767 |
short integer | short | 2 | -32 768 .. 32 767 |
long integer | long | 4 | -2 147 483 648 .. 2 147 483 647 |
unsigned integer | unsigned int | 2 | 0 .. 65 535 |
unsigned short integer | unsigned short | 2 | 0 .. 65 535 |
unsigned long integer | unsigned long | 4 | 0 .. 4 294 967 295 |
single-precision floating-point (7 Stellen) | float | 4 | 1.17E-38 .. 3.4E38 |
double-precision floating-point (19 Stellen) | double | 8 | 2.2E-308 .. 1.8E308 |
Keyword | Bytes | Range | C-Entsprechung (gcc) |
---|---|---|---|
int8_t | 1 | −128 .. 127 | signed char |
int16_t | 2 | −32768 .. 32767 | signed short, signed int |
int32_t | 4 | −2147483648 .. 2147483647 | signed long |
int64_t | 8 | −9223372036854775808 .. 9223372036854775807 | signed long long |
Keyword | Bytes | Range | C-Entsprechung (gcc) |
---|---|---|---|
uint8_t | 1 | 0 ..255 | unsigned char |
uint16_t | 2 | 0 .. 65535 | unsigned short, unsigned int |
uint32_t | 4 | 0 .. 4294967295 | unsigned long |
uint64_t | 8 | 0 .. 18446744073709551615 | unsigned long long |
Character | Type | Output format |
---|---|---|
C, c | int | a single-byte character |
d | int | Signed decimal integer. |
i | int | Signed decimal integer. |
o | int | Unsigned octal integer. |
u | int | Unsigned decimal integer. |
X, x | int | Unsigned hexadecimal integer |
E, e, f, G, g | double | Signed value; form [–]d.dddd e [-]dd[d] |
p | Pointer | Prints the address of the argument in hex. |
S, s | String | specifies a single-byte–character string. |
Macro PRIu8
- define PRIu8 "u"
decimal printf format for uint8_t
uint8_t val = karel.GetLineValues(); bt.printf("%x \n",val); hex bt.printf("%u \n",val); dec