Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c-preprocessor]

the macro preprocessor for the C and C++ computer programming languages.

2
votes
1answer
49 views

Syntax of binary Constants

I was trying to compile some Arduino code on the PC for testing when I noticed some strange syntax for numerical binary constants. Convetion seems to be to declare them like so: static const ...
5
votes
2answers
810 views

Detect if Serial1 and Serial2 are defined, at compile time

I have my library that uses Serial, Serial1 and Serial2 to establish various logging scenarios. Library user would define the config at class constructor, using simple byte constants like 0, 1 and 2. ...
0
votes
2answers
53 views

Preprocessing problem

I've a little problem, I'm trying to create a library with processor variables for tune it. So in .ino I declared my preprocessor var, but preprocessor variables appear not defined in my library. (...
8
votes
3answers
6k views

List of Arduino board preprocessor #defines

When one selects a board within Arduino IDE, a preprocessor definition is added to one of the behind-the-scenes files. After a lot of hunting and some good fortune I found that the format of this ...
23
votes
4answers
3k views

Why use an int variable for a pin when const int, enum or #define makes much more sense

Why do people use a variable to specify a pin number when the pin is unlikely to change throughout the execution of the code? Many times I see an int being used for a pin definition, int led = 13; ...