CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 14:55:38 GMT
content-type: text/html; charset=utf-8
cf-ray: 965cfa97fbeb2ffb-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=f36e5903-f2c2-4031-9ce3-06032a97c094; expires=Mon, 27 Jul 2026 14:55: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-miniprofiler-ids: ["5ceceaac-709f-4689-aec5-82a64fd4639e"]
x-request-guid: 5ceceaac-709f-4689-aec5-82a64fd4639e
x-worker-origin-response-time: 465000000
x-dns-prefetch-control: off
set-cookie: prov=f36e5903-f2c2-4031-9ce3-06032a97c094; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=7EFUx83gZoeDhX9iOlgkdckwtZo4eXhNVJwK5DMtHXE-1753628138-1.0.1.1-.SKc6D_JgjTOkXOYzA82JpZlJq4aJUgombSPA_vcPG_yWNN3CpvDl.NmJG9i.98tfeeVhSYbOjLQx9dP73qDFxHzCt4hrHyHONHuVdSDgSI; path=/; expires=Sun, 27-Jul-25 15:25:38 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=dTvV5xe.ddG_F0p4cX3XQ0kjAVO6Oiz3FNvtd3rRVdY-1753628138708-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
- Why did the Holy Spirit send Jesus to the wilderness to be tempted by Satan?
- Can expanding foam provide interior strength for a large model?
- What Isp can be gotten from a napthalene (mothball) hot gas thruster? Did it work in space?
- How do we know in capillary rise fluid eventually stops rising?
- When was the last time all humans were on the ground not in the air?
- Blinded despite Blindsight?
- “Unclear step in a math book for entertainment”
- "I met a monk and philosopher." How many people did I meet?
- spots / stains on tubeless tire
- What's the difference between an eVisa and ETA travel authorization?
- What is the weight of holy water?
- Confusing/incorrect sentence in proof of Zorn's Lemma in Lang's "Real and Functional Analysis"
- How to put commutative symbol in a commutative diagram?
- Not being introduced to the team – should I ask for it?
- Civilian airplanes with inside fuselage jet engines
- Still learning electronics, can you explain this voltage protector failure?
- Source for Adam naming the angels
- Is it possible to use the PC power button to pre-select the OS in rEFInd UEFI dual boot setup?
- Why am I winning always? A coincidence perhaps?
- Has the Silver Surfer's clothing (or lack thereof) ever been addressed in the comics?
- Were the Fantastic Four the only superheroes on Earth-828 in The Fantastic Four: First Steps?
- Why are police personnel of all ranks called officers?
- How to make that the object sliding down along the local axis while following the rotation of the another object?
- Will an error in two of my published papers affect my PhD thesis evaluation?