CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 12:37:02 GMT
content-type: text/html; charset=utf-8
cf-ray: 965c2f918cee6f7a-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=c4e7412f-6400-451e-ad57-82ab7541c16a; expires=Mon, 27 Jul 2026 12:37:02 GMT; domain=.stackexchange.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: 596bcdd6-dc9a-417d-8f45-346d1072e3f7
x-worker-origin-response-time: 327000000
x-dns-prefetch-control: off
set-cookie: prov=c4e7412f-6400-451e-ad57-82ab7541c16a; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=OA9qAbM69XktiACLvB_tvAXrqRYY9e1W8LQQAgvlLy4-1753619822-1.0.1.1-obJcyKH2LBm5oN7xkn6SYqGdCZtaXfpJQXpH0o2YZikITV8r6JIoBU6cvbj2mlpdmPeNX4jMYiYVHxHMAiqjSrmabaP_RXeNdA1nKZzLezA; path=/; expires=Sun, 27-Jul-25 13:07:02 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=Rx_N5ZzqYQW18EI84ZaNk0DYCgO5BuAkRNcB8Aq8LDQ-1753619822669-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'c-preprocessor' Questions - Arduino Stack Exchange
Skip to main content
Stack Exchange Network
Stack Exchange network consists of 183 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 ExchangeTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsQuestions tagged [c-preprocessor]
the macro preprocessor for the C and C++ computer programming languages.
16 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
2
answers
2k
views
is #ifdef __SD_H__ considered a bad practice?
Say I'm working on a library^1 to which I want to add support for SD.h^2 but knowing for a fact that many microcotrollers don't support SD.h (therefore they result in compilation errors [eg. Attiny85])...
-1
votes
1
answer
59
views
Unable to get my created library to work - while it compiles
I am experimenting with creating my own Arduino libraries. Unfortunately, while the program compiles, the end result does not work.
For purposes of experimentation, I have broken down the library in ...
0
votes
1
answer
152
views
#define from main (.ino) not considered by comiler in own libaries
I have got the problem, that my #define from main (.ino) is not considered by the comiler in my own libaries. This #define MQTT_MODULE is only considered in the main (.ino) programm, but not in ...
-1
votes
1
answer
138
views
Char Array in PreProcessor
I need to define an array, that later on will be the name of a class, and will be pointed to.
For example (in a non pre-processor way):
const char *button_names[4]={"b0","b1","...
1
vote
0
answers
49
views
How initialise and uninitialise serial based on the user's input?
In Summary. If the argument is true, I want to create a function that prints the necessary stuff into the serial. However, if its false serial is uninitialised and does not print anything, it only ...
0
votes
2
answers
207
views
Odd behavior of defines - is this Arduino specific and how does it work?
A question I have long had regards an interaction between #define statements and a library header include. I've seen several Arduino libraries use this rather convenient configuration system where you ...
user47164
0
votes
1
answer
89
views
A strange bug in my Arduino ALU
I have discovered a strange error in my Arduino. It's not in the code. I think it's a hardware bug in the ALU of the microcontroller, maybe in clone only.
So there is a variable called feedLimit and ...
0
votes
4
answers
120
views
How to link a computer processor to an Arduinno on a board? [closed]
I am completely new to Arduinno, so please forgive if the question is stupid.
Here is the problem: I have a project where I want an Arduino (or similar microchip board) to handle some sensors and ...
1
vote
1
answer
300
views
#define above static const int?
I see a lot of people, but also libraries, defining constants (like pin numbers, length of items etc) as #define:
#define LENGTH 5
While it is recommended to use in this case static const int:
...
2
votes
1
answer
244
views
Remove Function at Preprocessor Time
I have a single function for debugging messages, used through all the project. When KEYDEBUG is defined as 1 or 0, the function is enabled or disabled as required.
#define KEYDEBUG 0
void debugging(...
0
votes
1
answer
118
views
Segmentation fault and huge SRAM need for Serial.println
I have written my own 'assert' since I want to use it for both Windows and Arduino. The class is called from many files (about 10).
AssertUtils.h:
#pragma once
#define assert(expr) AssertUtils::...
2
votes
1
answer
382
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 ...
6
votes
2
answers
2k
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.
...
1
vote
2
answers
124
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. (...
22
votes
4
answers
19k
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 ...
- The Overflow Blog
-
-
- Featured on Meta
-
-
Related Tags
library × 5
programming × 4
serial × 3
constants × 3
arduino-nano × 2
c++ × 2
python × 1
header × 1
functions × 1
debug × 1
datalogging × 1
class × 1
c × 1
arduino-mega × 1
variables × 1
ide × 1
compile × 1
arduino-uno × 1
more related tags
Hot Network Questions
- How should one pronounce plural French-derived German words?
- “Unclear step in a math book for entertainment”
- Not your ordinary affix riddle
- Why are police personnel of all ranks called officers?
- how is it possible for a player to have crossed 2400 and secure 3+ IM norms to stay FM
- Rec Letter from Professor (who I haven't done research with) or from Work Supervisor
- Regenerative cooling of rocket engine turbine's blades
- Anonymizing a submission for double-blind review
- Source for Adam naming the angels
- Extensions of diagonalizable, respectively multiplicative-type, groups
- What is the meaning of 'Tel.......,qui......'
- Are you required to protect trade secrets revealed to you even if you didn't sign an NDA?
- Not being introduced to the team – should I ask for it?
- Why am I winning always? A coincidence perhaps?
- Will an error in two of my published papers affect my PhD thesis evaluation?
- What is the citation for Augustine's "consensus, non concubitus..."
- Story that taught cryptography in the form of a manga
- JK flip-flop timing diagram: is Wikipedia correct?
- About Harp Pedaling for a Pentatonic Glissando
- When did the OEIS get even better?
- Symbols for A.P. Morse's book in Set Theory
- What is the best way to bevel these corners without these deformations showing?
- A national poll of 1000 French returns 25% of "Yes". Is it enough to say that it's quite impossible locally to be 0%, if we don't know the variance?
- About security concerns using in find -exec vs interactively performing the same task