CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 18:54:39 GMT
content-type: text/html; charset=utf-8
cf-ray: 965e58b46e8da403-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=07a502ed-7d63-4a13-93d1-2dd8e206355e; expires=Mon, 27 Jul 2026 18:54:38 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: bf049928-6238-4a6d-9165-b3993bea9b72
x-worker-origin-response-time: 457000000
x-dns-prefetch-control: off
set-cookie: prov=07a502ed-7d63-4a13-93d1-2dd8e206355e; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=As1pde2Xp.Fc54dMPKdpr6SovSgTxQ3KaY8lKAQVfPQ-1753642479-1.0.1.1-240QmGYGqXa6UYPed1PTyRAS3_tBDY2d3intbku04CjzBS_5QkmxXN3w5g_7gDh5d5EZ6gtcZltj6eZpzlxlwr9i4Xk3sURcmPaN9BznCU0; path=/; expires=Sun, 27-Jul-25 19:24:39 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=P.mpumvz68OJAlbRXiF9TLW8qbGSLfrT7iKwDnUGC8U-1753642479249-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'c++' 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++]
C++ is the standard language used to program the Arduino IDE. However, the Arduino IDE does have lots of libraries built in, so functions such as "main" are not called directly in the sketch code. Most Arduino code online is written in this language.
1,069 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-1
votes
1
answer
62
views
How do I change what variable I am changing based on a separate number?
I am trying to change thing2 if I input 0, and thing3 if I input 1. I don't want to just have if/else to determine if I should be changing thing2 or thing3 because I want this to be more dynamic than ...
0
votes
1
answer
77
views
`sprintf` of %04d and %03x at the same time on Arduino
I have this code, work fine!
uint32_t id , id2;
char s[64]; // Should be enough
...
id2 = id = CAN.getCanId();
sprintf (s, "%04d : ", id ); // !!! HERE !!!
Serial.print(s);
the ...
1
vote
1
answer
55
views
Push button isn't pushed but keeps printing or inputting 1/HIGH
I have this Arduino code that will print 1 in the serial monitor and even prints two 1's. I haven't even pushed or clicked the push button, yet it already is already set to HIGH and even activates to ...
1
vote
1
answer
146
views
Why does the use of serial.readBytes increase program size by 10kb?
If I put this in my arduino program, in main.cpp, I suddenly run out of memory for flash program size:
if(msgSize > 2) {
//sr::sequentialRead(&serialRead, newTram.hash);
uint8_t bytes[...
0
votes
1
answer
65
views
Accessing invalid key in ArduinoJson causes ESP32 to reboot [closed]
I am running a project where I have multiple ESP32s communicate over WebSockets and I am using the Arduino IDE 2.3.4 for it. The communication primarily uses JSON and sends it as strings. To work with ...
1
vote
0
answers
40
views
"'StructName' does not name a type" when returning struct, but trailing return type works [duplicate]
Note: Please, do actually read the question before voting to close. This only happens in arduino IDE, this is not about a generic "Does not name a type" error. The code is perfectly valid as ...
0
votes
2
answers
89
views
Passing an array as an argument to a function [closed]
Please help how make it work.
int myArray1[] = {10, 11, 12};
int myArray2[] = {15, 16, 17};
void setup() {
Serial.begin(9600);
}
void loop() {
myFunction(myArray1); delay(1000); // i want to use ...
0
votes
1
answer
94
views
ESP32 pressure sensor readings (RFP602)
I have two RFP602 sensors that I use.
One connected to GPIO2, the other to GPIO4, each connected to a 1Mohm resistance.
The sensor connected to GPIO2 reads the data how I want it, I have to press a ...
1
vote
0
answers
67
views
0
votes
1
answer
66
views
How to use C++ user defined modules in Arduino
Does Arduino support C++ module import functionality i.e. what would it require to implement something like this in Arduino: import std;?
-1
votes
1
answer
91
views
Class private variable values not accessible in public function
I'm experimenting with classes in Arduino code. I have the following small code snippet:
#include "Motor.h"
#include "Arduino.h"
Motor::Motor()
{
}
void Motor::Configure(...
0
votes
1
answer
96
views
Problem with char* variable malloc/free. Empty contents on recipient variable after using free
I am working on a custom SD card data logger using the following function and struct:
char *filenameCreator(const char *prefix, const char *num, bool addExtension)
{
char *filename = (char *)...
0
votes
1
answer
171
views
deserializeJson() failed: NoMemory when sending Serial json using ArduinoJson
Hey all I have a sketch that takes up 99% of my storage space since I am using a Arduino Nano.
Although everything in my code fits as-is, there seems to be an issue with me sending a json string over ...
3
votes
0
answers
1k
views
How to use C++20 in Arduino IDE?
I'm writing a program for esp32 using the Arduino IDE that needs to count the number of '1' bits in a byte.
I found a post elsewhere that says there's a nice function in the standard library to do it: ...
1
vote
0
answers
221
views
LCD Wiki screen (ILI9341) works on Mega. How to get it working on the Due?
I have this exact LCD shield: https://www.lcdwiki.com/2.8inch_Arduino_Display
SKU: MAR2808
Driver IC: ILI9341
It works on an Arduino Mega 2560 using the old libraries the manufacturer (I assume) ...
- The Overflow Blog
-
-
- Featured on Meta
-
-
Related Tags
arduino-uno × 283
programming × 210
arduino-ide × 124
c × 84
serial × 72
arduino-mega × 68
library × 50
esp8266 × 46
class × 45
array × 43
string × 41
led × 37
arduino-nano × 33
sensors × 33
esp32 × 33
interrupt × 25
pointer × 22
sketch × 21
variables × 20
i2c × 20
memory-usage × 19
compile × 17
lcd × 17
softwareserial × 15
servo × 15
more related tags
Hot Network Questions
- Why is 0.0 printed as 0.00001 when rounding upward?
- 3D projective transformations on text in LuaMetaFun
- Is a Physics and Math double major worth it?
- Kepler's first law proof error - can anyone help me see what the error is?
- How can I turn the text in a PNG file back into text layer?
- How does one justify the rationality of buying insurance?
- how is it possible for a player to have crossed 2400 and secure 3+ IM norms to stay FM
- Forces applied to a car hood while driving
- Easy ways to draw vector diagrams in TikZ?
- In Fantastic Four 2025 shouldn't this thing have taken years?
- Alternative to tedious assert-rewrite for trivial operations?
- Does passive DisplayPort-HDMI adapter work with 4K 60Hz, if host supports DP 1.2 and HDMI 1.4?
- If a mathematical theorem is true, what it is true of?
- Why aren't there baleen whales at about the size of a dolphin?
- Calculus Books Recommendation
- Balancing a Holy Water Bomb
- How to deter wasps from an untreated larch fence
- Why does Timor-Leste call itself a "Democratic Republic" despite little apparent Marxist-Leninist ideology?
- 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?
- How to avoid aligning the top of nested braces in cases environment?
- Anonymizing a submission for double-blind review
- Is there any verse which says that throughout the Vedas the praise of Shiva is sung?
- What is the Greek word for God used in Codex Sinaiticus? John 1
- Why are police personnel of all ranks called officers?