

-----------------------------------

nobody

13 Feb 2024 06:03



-----------------------------------

prima chestie e

int x = 123456 // mai mare decat 16 biti, chiar si fara bitul de semn
...
cat e range-ul intului pe arduino uno (sau nano, 328P e nucleul, hint: e garantat sa aiba minim 16 biti, dar...)?

Din prima incercare pe Arduino:

warning: overflow in implicit constant conversion [-Woverflow]
 int vdiv2 = 100800;


Table 1. Data Types on AVR 8-bit Microcontrollers in <stdint>
Data type	Size
signed char / unsigned char = int8_t / uint8_t = 8-bit
signed int / unsigned int = int16_t / uint16_t = 16-bit
signed long / unsigned long = int32_t / uint32_t = 32-bit
signed long long / unsigned long long = int64_t / uint64_t = 64-bit

