All Questions

194
votes
12answers
331k 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 ...
87
votes
19answers
106k 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: ...
85
votes
19answers
14k 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++...
81
votes
3answers
72k 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?
72
votes
9answers
158k 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 ...
72
votes
7answers
33k 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 ...
63
votes
4answers
43k 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 ...
53
votes
7answers
112k 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 ...
51
votes
13answers
39k 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 ...
46
votes
17answers
12k 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 ...
46
votes
10answers
248k 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 ...
45
votes
2answers
49k 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 ...
44
votes
11answers
7k 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 ...
44
votes
7answers
67k 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 ...
42
votes
10answers
170k 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); ...
40
votes
5answers
103k 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?
39
votes
5answers
40k 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 ...
37
votes
4answers
8k 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 ...
36
votes
1answer
143k 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: ...
36
votes
4answers
52k 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 ...
36
votes
11answers
125k 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 ...
33
votes
6answers
15k 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 ...
33
votes
8answers
106k 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 ...
31
votes
3answers
29k 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 ...
31
votes
5answers
133k 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 ...
30
votes
19answers
82k 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 ...
28
votes
2answers
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?
27
votes
11answers
130k 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 ...
26
votes
4answers
68k 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 ...
26
votes
14answers
42k 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 ...
26
votes
6answers
36k 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 ...
25
votes
7answers
24k 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 ...
25
votes
2answers
39k 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?
25
votes
6answers
10k 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?
24
votes
14answers
5k 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 ...
24
votes
2answers
21k 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?
23
votes
5answers
48k 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?
23
votes
4answers
3k views

Why use an int variable for a pin when const int, enum or #define makes much more sense

Why do people use a variable to specify a pin number when the pin is unlikely to change throughout the execution of the code? Many times I see an int being used for a pin definition, int led = 13; ...
23
votes
1answer
44k 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 ...
23
votes
3answers
5k 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 ...
23
votes
3answers
42k 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 #...
23
votes
2answers
44k 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 ...
22
votes
8answers
10k 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 ...
21
votes
3answers
5k views

Can a function be called automatically when an input changes?

Currently, my sketch is checking an input pin every time round the main loop. If it detects a change, it calls a custom function to respond to it. Here's the code (trimmed down to the essentials): ...
21
votes
2answers
7k views

What's the difference between a clone and a counterfeit Arduino?

I've been hearing a lot about clones and counterfeits. What are the differences between the two?
21
votes
1answer
36k 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 ...
20
votes
4answers
82k views

What is Serial.begin(9600)?

I know that this is to print something: Serial.begin(9600); But I want to know what it really means?
19
votes
3answers
5k views

Classes and objects: how many and which file types do I actually need to use them?

I have no previous experience with C++ or C, but know how to program C# and am learning Arduino. I just want to organize my sketches and am quite comfortable with the Arduino language even with its ...
19
votes
5answers
6k views

I'm using too much RAM. How can this be measured?

I would like to know how much RAM I am using in my project, as far as I can tell, there's no way to actually work that out (other than going through and calculating it myself). I have got to a stage ...
19
votes
3answers
20k 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 ...

15 30 50 per page