Most Popular

1500 questions
245
votes
13 answers

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 board arrives I just have to upload and run my…
totymedli
  • 2,929
  • 3
  • 20
  • 22
184
votes
21 answers

"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: stk500_getsync(): not in sync: resp=0x00 All I want to do is…
The Guy with The Hat
  • 5,292
  • 7
  • 30
  • 51
135
votes
4 answers

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 along these lines: void loop() { unsigned long…
Edgar Bonet
  • 45,094
  • 4
  • 42
  • 81
105
votes
3 answers

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?
Nick Gammon
  • 38,901
  • 13
  • 69
  • 125
104
votes
9 answers

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 experienced in preprocessed languages like JavaScript, PHP,…
Friend of Kim
  • 1,543
  • 3
  • 16
  • 16
94
votes
22 answers

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++ and improve on these aspects?
DLJ
  • 1,149
  • 1
  • 10
  • 10
92
votes
7 answers

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 specific to the project (MyProjectLibrary1.h,…
jfpoilpret
  • 9,162
  • 7
  • 38
  • 54
83
votes
9 answers

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 another thread.
Bja
  • 953
  • 1
  • 8
  • 8
71
votes
12 answers

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 & servoId : Position How would I split these values up, and…
ValrikRobot
  • 843
  • 2
  • 8
  • 6
67
votes
2 answers

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: This is intended as a reference question.
Nick Gammon
  • 38,901
  • 13
  • 69
  • 125
65
votes
13 answers

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 Mega.
JVarhol
  • 1,903
  • 2
  • 17
  • 22
63
votes
7 answers

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 Arduino?
Cybergibbons
  • 5,420
  • 7
  • 34
  • 51
63
votes
4 answers

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 an error checking mechanism and then increasing…
Anonymous Penguin
  • 6,365
  • 10
  • 34
  • 62
62
votes
4 answers

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 to be 5V, and connect it to GND and 5V. Connect…
Mads Skjern
  • 1,145
  • 3
  • 13
  • 23
62
votes
7 answers

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?
The Guy with The Hat
  • 5,292
  • 7
  • 30
  • 51
1
2 3
99 100