Skip to main content

Questions tagged [variables]

Variables are used to store data in a sketch/program.

Filter by
Sorted by
Tagged with
14 votes
5 answers
82k views

I am using Arduino and I would like to know if there is a function that returns the data type of a variable. That is, I would like to run something as like the following: // Note: 'typeof' is a ...
user502052's user avatar
7 votes
2 answers
3k views

I am doing a project where, for troubleshooting reasons, I find myself often swapping components to different serial ports. Maybe one time it's in Serial, then in Serial1, maybe I need to try if ...
metichi's user avatar
  • 181
0 votes
2 answers
155 views

If I store in an array a double-value in this format, in which format I should be able to read the same double out? double myDouble = 12.123456; byte myArray[] = {0x00, 0x00, 0x00, 0x00}; myArray[0] ...
William Roy's user avatar
6 votes
1 answer
3k views

On an embedded system we use global variables often to keep dynamic memory consumption on heap and stack low. But global variables are also considered bad programming practice if they aren't used in a ...
Ariser's user avatar
  • 577
2 votes
2 answers
1k views

I'm using this piece of code to try to poll an IMU sensor at 100 Hz (for a AHRS sensor fusion library). void loop(void) { // nonblocking code variables static uint32_t last_ms; uint32_t ms; // ...
Zhelyazko Grudov's user avatar
1 vote
1 answer
3k views

I want to avoid global variables when using my own classes in Arduino. Here is a example. void setup(){ /* setup here */ classA objectA; } void loop(){ objectA.someMethod(); } I know that my ...
marquesm91's user avatar
0 votes
1 answer
980 views

I have a boolean function which contains a string. In my main project this string is extracted from a website using an ESP8266 which is compatible with the Arduino IDE. I need to convert this string ...
Lachlan Etherton's user avatar
0 votes
2 answers
917 views

I'm taking a sample I found on the web about how to get ROS and arduino to communicated together over serial. I have the sample working and now I'm moving the idea of the sample into my OOP project ...
Jacksonkr's user avatar
  • 327