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

learn more… | top users | synonyms

0
votes
0answers
9 views

Arduino Due Guitar Output Frequency Detection

I have been attempting to design a guitar tuner using an Arduino Due and a library called Arduino-FreqPeriod-Due. I have the guitar connected in the following way: Guitar Output Jack --> Guitar Cable ...
1
vote
1answer
83 views

How to accept user input (array, variables,…)

I am working on a project using my Arduino mega2560 that triggers a solenoid (maximum of three solenoids), my camera and my flash (maximum of two flashes). The core routine is there, and working. ...
0
votes
1answer
64 views

Arduino UNO + CC3000 Wifi Shield, Reading webpage data

I'm new so I might be making a stupid mistake, but I'm declaring: char dollars; at the begging of file, afterwards I'm reading a data from a web page, printing it to my serial. That part work well. ...
0
votes
2answers
41 views

Program button to switch between two values

There is a function on one of my programs I want to be switch on and off by pressing a button. The button is unbiased otherwise I would set the function to read the button's status of HIGH or LOW. So ...
0
votes
0answers
49 views

Matlab to Arduino communication

I am doing some computations on Matlab and I need to send those values to an Arduino Leonardo through USB serial connection. I need to send 2 variables which can vary from -400 to +400. I'm saying ...
0
votes
1answer
60 views

Can't store temperature in variable ( for further processing)

I am trying to store temperature data in a variable, so that I can use it for making a JSON object, but the problem is, that when I try to store the temperature in a variable, it prints out the wrong ...
3
votes
1answer
161 views

What are the benfits of global variables over static class members?

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 ...
2
votes
1answer
109 views

How to pass value of a function from the RFID-RC522 library into a variable then be sent into either serial or ethernet?

I'm using an RC522 RFID reader with an Arduino UNO. There is a function?? (or whatever it's called :)) in Miguel Balboa's new MFRC522.h library which is mfrc522.uid.uidByte[i] that prints the bytes of ...
3
votes
2answers
130 views

How to update a variable in an ISR using Timers

I'm trying to check the frequency of Timer3 using a counter. The value of the counter, declared as volatile, is incremented in the ISR and every second the sum is shown in the main loop and the value ...
2
votes
3answers
246 views

Convert long to char array and back

I'm trying to store a state in my data logger. I can read/write fine to SD, but I can't wrap my head around reading/writing a long value correctly - I've build it down to converting it to char array ...
3
votes
1answer
97 views

Assuring an unsigned long int?

Basic question: How far do I have to go to assure that integer math is done correctly? For example, this is probably overdone: unsigned long burnTime = 0UL; unsigned long curBurnTime = 0UL; // Do ...
0
votes
3answers
78 views

Help with a function that accepts different parameter types

I'm trying to create a function that prints out an XML tag with a value. I have the code below, but kind of stuck. I'd like to be able to call the function, and pass a value that could be a float, ...
0
votes
0answers
53 views

Read then write variable state after incrementing(++) or decrementing(--)

I am writing code for a project that allows me to switch between presets on my guitar amplifier (Fender Mustang) wirelessly using the "virtualwire" library. So far I have managed to get my code ...
3
votes
2answers
5k views

How can I declare an array of variable size (Globally)

I'd like to make three arrays of the same length. According to the documentation, Arrays must be defined as int myArray[10]; where 10 can be substituted for a known length (another integer), or filled ...
0
votes
0answers
60 views

Debugger with Breakpoint and Variable read/set capability

Is there any free/open or commercial/paid Arduino IDE Sketch Debugger (not Atmel chip factory standard tool set) with Breakpoint and Variable read/set capability? I read about VM on web. Is there ...
0
votes
1answer
185 views

How to send multi variable information over serial?

I would like to send information between my Arduino and my computer. Is there a way to send multiple variables from one Arduino? If so, how would I go about separating the variables?
4
votes
1answer
662 views

How to retrieve the data type of a variable?

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 ...
1
vote
1answer
447 views

Trouble with variable types and integrating DHT11 temperature sensor

I am trying to modify this sketch; https://github.com/itsallvoodoo/home_automation/blob/master/Arduino_HVAC_Controller/HVAC_Controller/HVAC_Controller.ino But I have a different temperature sensor, a ...
0
votes
1answer
70 views

Assigning formatted value to variable

Look at this snippet of code (from TinyGPS++ library): Serial.print(gps.location.lat(), 6); It prints the latitude location with 6 decimal points. I want, instead of printing that value, to have it ...
1
vote
2answers
630 views

Default value of global variables is not set

I am tracking a bug in the Marlin source code. Background Just for those who is not familiar with Reprap 3D printer and G-code: Marlin is firmware that controls a RepRap 3D printer. It receives ...
-1
votes
3answers
802 views

Pass variable in a url

Working on a code where I am able to manually enter the value in the url to let the php code save it in the database. But unsure how to it with a variable in a loop running. This is the URL: ...
0
votes
0answers
15 views

Passing variable in url [duplicate]

Working on a arduino script where I am right now entering manually the value with the URL, but wondering how to do it with a int in a loop. This is the url and how it works now: ...
-1
votes
2answers
517 views

When to use different variable types? [closed]

There are several different types in the Arduino programming language. They each have different applications that can use up the limited RAM in the Arduino. When should i use each?