CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 14:04:05 GMT
content-type: text/html; charset=utf-8
content-encoding: gzip
cf-ray: 965caf0fef433585-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=b4afb036-3fc9-4987-bc4a-626f4374bb5a; expires=Mon, 27 Jul 2026 14:04:05 GMT; domain=.stackexchange.com; path=/; secure; httponly
set-cookie: prov=b4afb036-3fc9-4987-bc4a-626f4374bb5a; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=4kfK0W.U25IuWM7PDk4yOZVJFa5m3pZ.mG58dY8Ed.U-1753625045-1.0.1.1-kTIXCxXcw8LP6_qPR4mlEC9ddBvPvYbADdVHKCsyDkHt9M38shjJyMmvTcHZ30.hZj4lPN2Zoz9rkyj7Fa6Z9f5qI8iIbg9OtT5ew_6QRxo; path=/; expires=Sun, 27-Jul-25 14:34:05 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=el9oFlgvmiMmPj8EalRPbR6KyeWuZ3QVD4lUqzKcFb0-1753625045251-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
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: 5bcddb21-f522-4b10-a319-b97df442f9e7
x-worker-origin-response-time: 776000000
x-dns-prefetch-control: off
server: cloudflare
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
- Lower bound on ratio of expected maxima of i.i.d. samples from distribution on [0,1]
- Is it possible to use the PC power button to pre-select the OS in rEFInd UEFI dual boot setup?
- What is the best way to bevel these corners without these deformations showing?
- Existence of Jordan curves between a compact and an open set
- When was the last time all humans were on the ground not in the air?
- Is this a violation of open source?
- What is the meaning of 'Tel.......,qui......'
- Is there such a thing as 'aerospace grade software'?
- Not your ordinary affix riddle
- Why does Gaza Humanitarian Foundation (GHF) not distribute more food in Gaza?
- Can a minor run a business by having an adult act on their behalf?
- Alternative to tedious assert-rewrite for trivial operations?
- How many simple groups are there of a given infinite cardinality?
- Anonymizing a submission for double-blind review
- What's the difference between an eVisa and ETA travel authorization?
- Regenerative cooling of rocket engine turbine's blades
- Heretofore I think I have been using 'heretofore' incorrectly
- Humans on alien planet get tailed by silent humanoids
- Will a reinforced 1" concrete slab be durable?
- Why aren't there baleen whales at about the size of a dolphin?
- What were the two colored keys on a MUPID for?
- Civilian airplanes with inside fuselage jet engines
- How can my dwarves keep humans from reverse engineering their technology?
- Symbols for A.P. Morse's book in Set Theory