Most Popular
1500 questions
15
votes
1 answer
Is there a preprocessor constant for memory size
I would like my compiles to exclude some code depending upon the flash/program space available. To be used in the demo code of a library I support. Whereas my current solution is to use a #ifdef of processor type. But I would like to be more general…
mpflaga
- 2,513
- 13
- 13
15
votes
2 answers
Post Data To a Web Service From Arduino
If you want to submit sensor data such as temperature to a remote server/database somewhere you need to use some kind of call to a web server since it isn't possible to connect directly to a database from the Arduino.
How do you post data to a JSON…
HK1
- 397
- 1
- 4
- 10
15
votes
2 answers
Why does an `.ino` file have to be in a folder of the same name?
I'm trying to organise a very complicated project and I want to put all the actual code in a folder named src (source), but I want to keep the main .ino file as main.ino (it will also be in src). Then when I try to open the code, the IDE says that…
Dat Ha
- 2,913
- 6
- 23
- 45
15
votes
2 answers
Set PWM frequency to 25 kHz
I currently can set four PWM pins to around 31 kHz with the following code:
void setup()
{
TCCR1B = TCCR1B & B11111000 | B00000001; // Set PWM frequency for D9 & D10:
pinMode(pwmPin9, OUTPUT); // Sets the pin as output
pinMode(pwmPin10,…
user16307
- 237
- 2
- 4
- 15
15
votes
4 answers
ESP8266, Arduino IDE vs Lua?
I'm planning to buy an ESP8266. Do I really need to learn Lua to play with it? I have seen some people using it with the standard Arduino IDE.
Do you need a custom firmware to use the Arduino IDE instead of Lua?
The Arduino IDE seems better for me…
n0tis
- 375
- 2
- 3
- 9
15
votes
2 answers
Difference between /dev/ttyACM0 and /dev/ttyS0 (Arduino IDE ports under Linux)
I use the Arduino IDE to upload sketches to my Arduino Uno. My OS is Linux Ubuntu 14.04 LTS. The Arduino IDE has two ports by default for communication with the Arduino Uno:
/dev/ttyACM0
/dev/ttyS0
What is the difference between these two ports ?…
martin_0004
- 281
- 1
- 4
- 8
15
votes
2 answers
Button state changing randomly
I have a push button wired to my Arduino but it seems to be triggering randomly.
I have one pin of the button connected to pin 2 on the arduino and the other connected to ground.
void setup() {
Serial.begin(9600);
pinMode(2, INPUT);
}
void…
sachleen
- 7,525
- 4
- 39
- 57
15
votes
1 answer
What happens when code is uploaded using the bootloader?
When I upload a new sketch to my Arduino Uno using the Optiboot bootloader, what really happens?
What is sent to the Arduino?
How does it respond?
What does "not in sync mean"?
What is "in sync" anyway?
Note: This is intended as a "reference…
Nick Gammon
- 38,184
- 13
- 65
- 124
15
votes
3 answers
Use all pins As digital I/O
Increase the number of digital pins
There are many post that explain how to use more than just the standard pins on the various arduinos but none of them explain the limitations and the proplems properly.
Arduino Uno:
1.You can use the analog…
cocco
- 431
- 5
- 7
- 15
15
votes
5 answers
Programming options other than C++
Can I program my Arduino using any programming language other than C++? If so, which programming languages? What software would I need for compiling and loading my code onto the Arduino?
tstew
- 729
- 1
- 6
- 26
15
votes
2 answers
What is the difference between the revisions of the Arduino Uno board?
There are three different revisions of the Arduino Uno. What changed in each revision?
tstew
- 729
- 1
- 6
- 26
15
votes
3 answers
Is it possible to find the time taken by millis?
The function millis would be running in the span of 100+ microseconds or less. Is there a reliable way to go about measuring the time taken by a single millis call?
One approach that comes to mind is using micros, however, a call to micros will…
asheeshr
- 3,837
- 3
- 25
- 61
15
votes
6 answers
What's the difference/relationship between Arduino and AVR?
I'd always thought Arduino was a microcontroller platform but the actual microcontroller is an AVR chip made by Atmel, or something like that made by someone else, based on a RISC ISA, and Arduino is usually used to refer to the whole circuit board…
user3383182
14
votes
2 answers
Split up Arduino code into multiple files using Arduino IDE
I am working on a very long code that requires multiple functions defined. I want to split the code into two files as main code ("Feeder_Control" in the screenshot) and functions ("connections" in the screenshot) How to import the second file into…
Salitha Indrajith Pathiraja
- 243
- 1
- 2
- 5
14
votes
1 answer
How millis() resets itself to 0
Looking at the documentation for the millis() function , it says:
Returns the number of milliseconds since the Arduino board began
running the current program. This number will overflow (go back to
zero), after approximately 50 days.
How's…
Programmer
- 362
- 4
- 11