CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 12:38:35 GMT
content-type: text/html; charset=utf-8
cf-ray: 965c31d61d7accbb-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=5f7721b2-a8cf-4048-8404-445a444e2afb; expires=Mon, 27 Jul 2026 12:38:35 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: 7a8480b0-efa5-46be-9e19-af70a7d87354
x-worker-origin-response-time: 415000000
x-dns-prefetch-control: off
set-cookie: prov=5f7721b2-a8cf-4048-8404-445a444e2afb; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=QfqwOYsnhsatJFRwFJvTYb_z5RgOrGWC282nX5pXqC0-1753619915-1.0.1.1-XDksyr1A0o4ydmqWHF08ggjxP.yRPJ2Qf9RWAor5VPDYmDmC1CnZiOXZ0x1PiEv7SAgOCTKW8Qa7FhrdMh6.HmSBpoXnbYDZ9LHXrVET4hE; path=/; expires=Sun, 27-Jul-25 13:08:35 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=11M_d87QALQR6Bzu3IycO1JBad1klgWw37P_mwHGBRY-1753619915651-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'variables' 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 [variables]
Variables are used to store data in a sketch/program.
162 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 ...
-1
votes
1
answer
293
views
Declaration of global variables in separate file: compiler conflict
So I have:
1/ My myapp.ino file, that includes src.h (implemented in src.cpp). Compiled for Arduino Uno.
2/ I also have a unit-tests.cpp file that is meant to test functions in src.cpp. Compiled for ...
-1
votes
1
answer
888
views
Multiple definition error in STM32CubeIDE
How do global variable declarations work?
For example:
In file1.c I am defining:
#define volt_add 0x20
uint8_t vol[8]= {0x53, 0x35, 0x05, 0x22, volt_add,0x00,0x00,0x00};
uint16_t EM_vol;
I need to ...
1
vote
2
answers
94
views
converting comma delimited Serial message to 7 Unsigned Long variables
Working on a project where I get an input where its a comma delimited string like:
"255,10000000,42949672950254,12,22".
and then the numbers (no commas), would be split into 6 Long ...
0
votes
1
answer
1k
views
how to "skip" one parameter of a method with a default value letting it use it's default value, but change parameters after it [closed]
lets say we have a function like this(fictional):
function1(int Z, int X, bool Y=true, int Count=10, int ID=1,bool TeaTime=false);
And I want to run this function, but I want to change all parameters,...
0
votes
2
answers
302
views
IsTimeSet library - Assign variables
i get the current time with the example code istimneforset, everything works fine.
now i want to get the current time from the function "Serial.println(timeClient.getFormattedTime());" and i ...
1
vote
1
answer
256
views
Conditional assignment of array
I have some really long global variable arrays filled with data.
There is a single function that processes the data. The function works on only one array everytime. This arrays value changes every ...
0
votes
1
answer
252
views
What's the difference between CloudTemperature, CloudTemperatureSensor and Float data types?
I have a SHT30 sensor for Wemos and I am learning to use Arduino IOT Cloud.
I use float data type for my temperature variable but I see two more data types:
CloudTemperature
CloudTemperatureSensor
...
0
votes
1
answer
83
views
Wrong use of memory?
Probably I'm doing something wrong.
I'm writing an Arduino sketch for ESP32.
Among the others I have this function:
#define HDR_MAX_LENGHT 4
#define CMD_MAX_LENGHT 5
#define ARG_MAX_LENGHT 5
#define ...
-2
votes
1
answer
817
views
how to save float with 3 decimal places [duplicate]
i am transmitting sensor data from my atmega328p to my esp8266. The Sensordata has 3 decimal places. The esp8266 sends this data to my pc and there I see only two digits. This is because the data is ...
0
votes
1
answer
83
views
Inconsistent behavior of include statements?
This question deals with fonts. Well, actually, singular include files with constants that form bitmap fonts or images for LCD or OLED displays, such as this one: https://github.com/ThingPulse/esp8266-...
0
votes
3
answers
2k
views
How do I modify the value of a variable when I press a switch
I am new to arduino and I want to make a project where I have a motor spinning clockwise then when a button is pressed it spins anti-clockwise and if it is pressed again it goes back to clockwise etc.....
1
vote
1
answer
434
views
1 global variable consuming 19% of memory
I am working on a simple project on talking to the serial monitor, and my only global variable ("int" type, named "incomingByte") is consuming a lot of memory. There is no problem ...
-1
votes
1
answer
87
views
Initializing an object as class member resulting in linking error?
I'm a little dumbfounded as to why this isn't working. I keep getting the following linker error:
In file included from src\ac.cpp:1:0:
src/ac.h:9:21: error: expected identifier before numeric ...
2
votes
1
answer
3k
views
Space taken by Global Variables
Using Nano's for small programmes I get compilation reports about the amount of space taken by global variables.
On a typical progamme it says something like Sketch uses 16316 bytes (53%) of program ...
- The Overflow Blog
-
-
- Featured on Meta
-
-
Related Tags
arduino-uno × 41
c++ × 20
programming × 20
array × 14
serial × 11
memory × 11
float × 9
c × 8
arduino-mega × 7
esp8266 × 7
class × 6
memory-usage × 6
data-type × 6
eeprom × 6
sketch × 6
functions × 6
string × 5
sram × 5
arduino-ide × 4
led × 4
button × 4
interrupt × 4
display × 4
pointer × 3
sensors × 3
more related tags
Hot Network Questions
- Extensions of diagonalizable, respectively multiplicative-type, groups
- "I met a monk and philosopher." How many people did I meet?
- Civilian airplanes with inside fuselage jet engines
- Symbols for A.P. Morse's book in Set Theory
- Do TeX engines support Shavian OpenType fonts?
- Story that taught cryptography in the form of a manga
- Is there such a thing as 'aerospace grade software'?
- How many simple groups are there of a given infinite cardinality?
- Did Denmark report that 64% Palestinian refugees from 1992 received serious fines or jail time?
- About Harp Pedaling for a Pentatonic Glissando
- Calculus Books Recommendation
- What does "enter the hold at arden" mean
- How can my dwarves keep humans from reverse engineering their technology?
- Alternative to tedious assert-rewrite for trivial operations?
- Why is 0.0 printed as 0.00001 when rounding upward?
- I don't understand Photos Library.photoslibrary
- Not your ordinary affix riddle
- In Fantastic Four 2025 shouldn't this thing have taken years?
- Why is time reversal not a natural part of the Galilean group?
- Moving multiplying cells away
- Book recommendations for theistic books about God's existence
- Existence of Jordan curves between a compact and an open set
- Word order for a phrase with a number, adjective and noun
- Shared-Memory Queue Implementation in C