Variable declaration
It is recommended to declare global variables before the setup function of the code. For example:
1
// Global variables declaration
2
char str[] = "This is a string";
3
uint8_t number = 0;
4
int counter = 0;
5
6
void setup()
7
{
8
}
9
10
void loop()
11
{
12
counter++;
13
USB.println(str);
14
number = 121;
15
}
Copied!
Variable types defined in <stdint.h>:
1
typedef signed char int8_t
2
typedef unsigned char uint8_t
3
typedef signed int int16_t
4
typedef unsigned int uint16_t
5
typedef signed long int int32_t
6
typedef unsigned long int uint32_t
7
typedef signed long long int int64_t
8
typedef unsigned long long int uint64_t
Copied!
Copy link