All Questions
24,092
questions
237
votes
13
answers
454k
views
Can I program for Arduino without having a real board?
I would like to start the development of some basic Arduino projects but I don't own an Arduino board yet. Is there a way I can write my code and emulate/test it using a desktop computer so after my ...
169
votes
21
answers
474k
views
"avrdude: stk500_getsync(): not in sync: resp=0x00," aka Some Dude Named Avr Won't Let Me Upload My Program
I made an awesome program the other day, and I wanted to upload it to my Arduino. After clicking the upload button, some mean dude named avr came along and stopped me, saying:
avrdude: ...
128
votes
4
answers
96k
views
How can I handle the millis() rollover?
I need to read a sensor every five minutes, but since my sketch also has
other tasks to do, I cannot just delay() between the readings. There
is the Blink without
delay tutorial
suggesting I code ...
103
votes
3
answers
107k
views
Have I bricked my Arduino Uno? Problems with uploading to board
I can't upload sketches to my Arduino Uno.
Have I "bricked" it?
What steps can I take to work out what is wrong?
What can I do to fix it?
101
votes
9
answers
252k
views
C++ vs. The Arduino Language?
What are the advantages of each language when using the Arduino?
I'm thinking this is a good general question, but I'll add a bit about why I'm asking if anyone wants to give me a tip.
I'm ...
93
votes
22
answers
18k
views
What are the other IDEs for Arduino?
The basic Arduino IDE lacks a lot of the sophistication present in other IDEs such as code completion, code collapsing, folder organisation, etc. Are there other IDEs that allow programming in C or C++...
90
votes
7
answers
52k
views
How to organize my Arduino projects' structure for easy source control?
It's been a long time I've been looking for a good answer to this question.
Typically, any Arduino project but the simplest one will include:
The main source code file MyProject.ino
Libraries ...
77
votes
9
answers
165k
views
How can I create multiple running threads?
Is there a way I can have multiple parts of the program running together without doing multiple things in the same code block?
One thread waiting for an external device while also blinking a LED in ...
67
votes
12
answers
427k
views
How do I split an incoming string?
I am sending a list of servo positions via the serial connection to the arduino in the following format
1:90&2:80&3:180
Which would be parsed as:
servoId : Position & servoId : Position ...
66
votes
1
answer
221k
views
How do you use SPI on an Arduino?
With reference to the Arduino Uno, Mega2560, Leonardo and similar boards:
How does SPI work?
How fast is SPI?
How do I connect between a master and a slave?
How do I make an SPI slave?
Please note: ...
62
votes
13
answers
77k
views
Is there a way to have more than 14 Output pins on arduino?
Is it possible to have more than 14 output pins on the Arduino, I am working on a project in which I need to light up several LEDs individually. I only have an Arduino Uno, and I don't want to get a ...
61
votes
7
answers
103k
views
Is using malloc() and free() a really bad idea on Arduino?
The use of malloc() and free() seems pretty rare in the Arduino world. It is used in pure AVR C much more often, but still with caution.
Is it a really bad idea to use malloc() and free() with ...
60
votes
7
answers
204k
views
Is there any way to download a sketch from an Arduino?
I made a sketch, but then I lost it. However, I uploaded it to the Arduino before losing it. Is there any way I can get it back?
57
votes
4
answers
252k
views
What are the 5V and VIN pins for?
I believe I can supply the Arduino with power in three different ways:
Use USB. The design trusts the 5V to be regulated, and does not regulate it in any way.
Use a regulated power source, trusted ...
56
votes
4
answers
93k
views
How high of a baud rate can I go (without errors)?
The standard is 9600 baud. That's just the standard. Using a Arduino Uno SMD R2, what is the highest practical baud rate I can achieve?
Bonus points for the audacious: How would you go about creating ...
52
votes
12
answers
264k
views
How do I print multiple variables in a string?
Say I have some variables that I want to print out to the terminal, what's the easiest way to print them in a string?
Currently I do something like this:
Serial.print("Var 1:");Serial.println(var1);
...
51
votes
2
answers
66k
views
What happens if I power the Arduino with both the USB and external power voltage simultaneously?
I am a new Arduino user. I am not sure whether I can connect both USB and external supply through power adaptor to Arduino simultaneously. Would this burn the controller?
Basically, I want to ...
48
votes
11
answers
12k
views
Is an Arduino capable of running 24/7?
I'm making a simple Arduino web server and I want to keep it turned on all the time. So it must endure to stay working continuously.
I'm using an Arduino Uno with a Ethernet Shield.
It's powered ...
48
votes
17
answers
14k
views
How to trigger an alarm when toilet paper is low?
Anyone with kids knows they never help with the toilet paper. Anyone know how to track when it's low or out and sound an audible alarm? I just don't know what sensor to use that may help.
Some that ...
47
votes
11
answers
150k
views
Mac OSX Yosemite no serial ports showing for Uno R3
I have a MacBook Pro running OS X Yosemite (10.10.3). I connected my Arduino UNO R3 to my computer for the first time after the Yosemite upgrade - it worked fine before this!
When I opened the ...
46
votes
20
answers
135k
views
Serial data plotting programs
I need to plot serial data from Arduino.
I require support for:
Various data formats (e.g. signed, unsigned, 8 bits, 16 bits);
Plots several data on the same axes;
Exports / Imports file data.
As ...
43
votes
4
answers
10k
views
What are (or how do I use) the power saving options of the Arduino to extend battery life?
For solar & battery powered projects, decreasing power consumption is a necessity.
I know a little bit about using a timer and interrupt to put the microcontroller into sleep when it isn't doing ...
43
votes
6
answers
23k
views
Serial.begin(): Why not always use 28800?
In a lot of the sample code online people add the line Serial.begin(9600) in the setup block.
When I look up what Serial.begin() is on the official documentation, it says that it controls the bit per ...
42
votes
5
answers
46k
views
Difference between Arduino.cc and Arduino.org
Recently I have noticed that there are two arduino sites, arduino.cc and arduino.org. They both have the Arduino logo and both sell what seems to be official Arduino boards. Also, arduino.org came ...
42
votes
5
answers
142k
views
What is the difference between Serial.write and Serial.print? And when are they used?
What is the difference between Serial.write and Serial.print? And when are they used?
Both have been used to print on serial monitor, what are their actual differences?
42
votes
4
answers
48k
views
Why does starting the serial monitor restart the sketch?
If I upload any sketch that sends serial data, I immediately see the TX/RX LEDs flash once the sketch is uploaded. If I then start the serial monitor, the sketch appears to restart.
A bare minimum ...
40
votes
10
answers
176k
views
Programming an Arduino using Python, rather than C/C++
I am not very skilled with the C Language and I was wondering if there is a way in which python could be used to program an Arduino. This would most likely require a different IDE in order to be able ...
38
votes
2
answers
31k
views
Warning when verifying sketch with VS code
I use Visual Studio Code to develop for arduino which uses Arduino Studio installed files and needs the installation to work. This works very well.
Annoying is that when verifying a sketch it takes ...
37
votes
12
answers
135k
views
Arduino Nano uploading gives error: avrdude: stk500_recv(): programmer is not responding
I have a Arduino Nano (Sainsmart) that I'm trying to upload a sketch to. Under the Arduino IDE, the device selected was Arduino Nano w/ ATmega328.
However uploading the sketch gives me the error
...
35
votes
6
answers
56k
views
How to get HTTPS on Arduino?
Put plainly: is there a way to get an HTTPS connection on the Arduino?
I have been looking in to it, and I have found it is impossible with the standard library and the Ethernet shield, but is there ...
34
votes
12
answers
164k
views
How can I connect to an Arduino using WiFi?
I'm working on building a solar powered, Arduino based weather station. The weather station consists of a temperature sensor and a photoresistor, and I plan to add an anemometer in the future. I would ...
33
votes
14
answers
56k
views
Most compact method of powering Arduino from wall socket
There are a lot of methods to power an Arduino from a large range of voltages:
USB cable from PC or from a phone charger or an USB hub
step down converters
step up converters
switching power supply
...
33
votes
2
answers
64k
views
What are the AREF, IOREF, and the unlabeled pin next to IOREF on the Uno R3?
There are some pins on the Arduino which I haven't been able to find out anything about:
IOREF
AREF
An unlabeled one next to IOREF
What are they?
32
votes
2
answers
38k
views
How does the Arduino handle serial buffer overflow?
How does the Arduino handle serial buffer overflow? Does it throw away the newest incoming data or the oldest? How many bytes can the buffer hold?
31
votes
5
answers
24k
views
What does it take to compile Linux on Arduino, if at all possible?
Is it possible to run Linux on Arduino? If yes, what steps and limitations need to be considered? If not, what are the limitations that prevent this?
31
votes
1
answer
55k
views
Whats the difference between RF options (wifi, xbee, NRF24L01)
When doing RF, you have many options.
Three of the most basic are in the title box
WiFi
Xbee
NRF24L01
What are the practical differences in using them. What is the purpose of each other and the pros ...
30
votes
4
answers
80k
views
What can I do if I run out of Flash memory or SRAM?
According to the Arduino documentation, the ATmega328 has 32KB of Flash memory for the bootloader + uploaded sketch, and only 2KB SRAM for runtime data. The ATmega2560 has quite a bit more, totalling ...
30
votes
6
answers
53k
views
How to compile, upload and monitor via the Linux command line?
Interfacing an Arduino Uno (uploading etc.) with the Arduino IDE (using the Fedora package) works fine under Fedora 21.
But I rather want to use vim + make + vim-quickfix-mode etc.
How can I do that?...
30
votes
4
answers
56k
views
Is it better to use #define or const int for constants?
Arduino is an odd hybrid, where some C++ functionality is used in the embedded world—traditionally a C environment. Indeed, a lot of Arduino code is very C like though.
C has traditionally used #...
30
votes
2
answers
65k
views
Arduino as USB HID
Is it possible to build a HID device (like a keyboard) using an Arduino uno?
At the time being, I have button inputs on the Arduino giving outputs on the serial line. So, how can I transform my ...
29
votes
8
answers
18k
views
Are global variables evil in Arduino?
I'm relatively new at programming and many of the coding best practices I'm reading effectively state that there are very few good reasons to use a global variable (or that the best code has no ...
28
votes
3
answers
126k
views
What is Serial.begin(9600)?
I know that this is to initialize something:
Serial.begin(9600);
But I want to know what it really means?
28
votes
7
answers
36k
views
How can I get a unique ID for all my Arduino boards?
Once you have uploaded a sketch to one of your Arduino boards, it is hard to know exactly what source code led to that sketch.
Indeed, you may change the source code of your sketch on your PC without ...
27
votes
2
answers
10k
views
Arduino USB Power vs External Power Supply
Why is the Arduino able to accept ~5V from the USB, but requires a min of 7V when using an external power supply?
26
votes
5
answers
111k
views
First time set up- permission denied to usb port- ubuntu 14.04
I just plugged my arduino in and the light is on, but the blink test failed to upload. here is my error:
Arduino: 1.6.7 (Linux), Board: "Arduino/Genuino Uno"
Sketch uses 1,030 bytes (3%) of program ...
26
votes
3
answers
6k
views
What happens to the Arduino if you don't use a resistor with an LED?
Making a blinking light seems to be one of the most common beginner projects with Arduino. A typical approach is to connect an LED + resistor (in series) to an IO pin, and connect the other end to ...
25
votes
14
answers
6k
views
Project Showcase '14
The logo is a derivative of the Arduino Community Logo licensed under Creative Commons license CC-SA-BY-NC 3.0
Update: Winners Announced
The winners of the contest have been announced. Please see ...
25
votes
1
answer
40k
views
ATtiny85: Power consumption vs clock speed
Short and simple: What is the power consumption for an ATtiny85 running at 1 MHz and 8 MHz using the internal clock? Not using any sleep modes.
I have googled a lot and can't find any info on this. I ...
25
votes
1
answer
55k
views
What is the frequency of PWM output on Arduino
What frequency do Arduinos use for normal PWM when you use analogWrite()?
And is it different for different Arduino model? I'm interested specifically in the Mega 2560, but also want to know if it's ...
24
votes
5
answers
39k
views
What is the real lifetime of EEPROM?
ATMEL says the cell lifetime of an EEPROM cell is about 100,000 write cycle/ cell.
Is this actually how the EEPROM performs in the wild?
If I do not change the value of a cell, does this stress the ...