24,983 questions
244
votes
13
answers
473k
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 ...
184
votes
21
answers
663k
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: ...
135
votes
4
answers
118k
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 ...
105
votes
3
answers
116k
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?
103
votes
9
answers
270k
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 ...
94
votes
22
answers
19k
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++...
92
votes
7
answers
59k
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 ...
83
votes
9
answers
197k
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 ...
71
votes
12
answers
456k
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 &...
67
votes
2
answers
229k
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: ...
65
votes
13
answers
84k
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 ...
63
votes
7
answers
111k
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 ...
63
votes
4
answers
110k
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 ...
62
votes
7
answers
230k
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?
61
votes
4
answers
277k
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 ...