Questions tagged [arduino]

ARDUINO QUESTIONS MUST BE PROGRAMMING RELATED. Arduino is an open-source electronics prototyping platform based on easy-to-use hardware and software. Questions should relate to programming Arduinos only (as in contain code). General Arduino questions may be asked on https://arduino.stackexchange.com or https://forum.arduino.cc

There is now an Arduino specific Q&A board under the Stack Exchange network, at https://arduino.stackexchange.com It is recommended you ask your questions there, as it covers all Arduino project questions, and not just coding related issues.

Arduino refers to both the hardware (single boarded micro-controller) and the software (a minimized IDE based on the Processing IDE) which makes hardware prototyping simple and engaging for people with little or no programming experience.

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.arduino.cc

Coding Arduino is simplified by the "Wiring based language", helper functions and handling of code behind the scenes (via AVR Libc and avrdude). Because "The Wiring Language" adds just a thin layer on top of C++ advanced users can use their preferred C/C++ IDE alternatively.

Picture of the Arduino Uno board

"The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started." more details on the Arduino Wiki

Arduino is open-source, meaning that anyone can manufacture a compatible board and the official site offers detailed instructions. Similar projects include:

There are also similar pin compatible versions such as:

If the question is not programming related then it may be on-topic at Raspberry Pi Stack Exchange, Internet of Things Stack Exchange or Unix & Linux Stack Exchange.

19255 questions
31
votes
5 answers

Can't save the output of minicom into a file

When I use Minicom to capture data from a serial port, I need to save the big data into a file, named minicom.cap. However, if I press Ctrl+A and L to capture file, it failed. No file was created (minicom.cap did not exist beforehand). My download…
Kerwong
  • 398
  • 1
  • 4
  • 7
30
votes
2 answers

Arduino Bootloader

Can someone please explain how the Arduino bootloader works? I'm not looking for a high level answer here, I've read the code and I get the gist of it. There's a bunch of protocol interaction that happens between the Arduino IDE and the bootloader…
vicatcu
  • 5,407
  • 7
  • 41
  • 65
30
votes
4 answers

Python to automatically select serial ports (for Arduino)

Currently the python program must know which port a device (Arduino) is on before Python can communicate the device. Problem: Whenever the device is plugged out and back in, its COM port changes, so the correct serial port must be given to Python…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
30
votes
2 answers

What does Arduino's "F()" actually do?

I have asked a similar question before, but I realize that I can't make heads or tails of the macrology and templateness. I'm a C (rather than C++) programmer. What does F() actually do? When does it stuff characters into pgmem (flash)? When does it…
iter
  • 4,171
  • 8
  • 35
  • 59
28
votes
5 answers

How is programming an Arduino different than standard C?

I have a background in programming embedded systems (TI MSP430, Atmel ATxmega). How is programming an Arduino different than those? What knowledge about C can I take in to programming the Arduino?
Nathan
  • 835
  • 3
  • 11
  • 20
28
votes
10 answers

Bash, serial I/O and Arduino

So, I'm in a bit over my head, and I feel like I'm very close to a solution, but it's just not working quite yet. Here's my situation: I'm working with an Arduino microcontroller, and I'm attempting to write two Bash scripts (right now running in…
Myk
  • 6,205
  • 4
  • 26
  • 33
28
votes
2 answers

What is the secret of the arduino `yield()`function?

The Arduino docs explain yield() at https://www.arduino.cc/en/Reference/Scheduler with regards to the Due. Apparently it is part of the Scheduler library: #include However, I can call yield() on my Nano or ESP8266 without including…
andig
  • 13,378
  • 13
  • 61
  • 98
28
votes
8 answers

How to auto-detect Arduino COM port?

I'm using an Arduino with the Firmata library for communication to a C# application, and I want to eliminate a COM port configuration component since it can change from machine to machine... Is it possible to: Enumerate list of COM ports in the…
Brandon
  • 13,956
  • 16
  • 72
  • 114
28
votes
9 answers

C Function to Convert float to byte array

I'm trying to make a function that will accept a float variable and convert it into a byte array. I found a snippet of code that works, but would like to reuse it in a function if possible. I'm also working with the Arduino environment, but I…
Ben Winding
  • 10,208
  • 4
  • 80
  • 67
27
votes
21 answers

How can I "reset" an Arduino board?

I've uploaded a sketch to an Arduino Uno whose loop is something like this: void loop(){ Serial.println("Hello, World!"); } So, now, I can't upload anything anymore, because the IDE says "port already in use". Is there a way to "reset" the…
dugres
  • 12,613
  • 8
  • 46
  • 51
27
votes
3 answers

Do interrupts interrupt other interrupts on Arduino?

I have an Arduino Uno (awesome little device!). It has two interrupts; let's call them 0 and 1. I attach a handler to interrupt 0 and a different one to interrupt 1, using attachInterrupt() :…
Chris Laplante
  • 29,338
  • 17
  • 103
  • 134
27
votes
6 answers

Working Android with Arduino

Has anyone tried to make Android and Arduino communicate with each other? I found a couple of projects online: Amarino Android-Arduino What do you guys suggest is the best way to make those two communicate?
unj2
  • 52,135
  • 87
  • 247
  • 375
27
votes
7 answers

Arduino Emacs development

I would like to use Emacs as a development environment for Arduino programming. What are some tips or links to use Emacs to program Arduino? Is there an official (or de facto) Emacs mode? Also, am I going to miss something in Arduino IDE if I use…
Anycorn
  • 50,217
  • 42
  • 167
  • 261
27
votes
7 answers

Reversible pseudo-random sequence generator

I would like some sort of method to create a fairly long sequence of random numbers that I can flip through backwards and forwards. Like a machine with "next" and "previous" buttons, that will give you random numbers. Something like 10-bit…
PapaFreud
  • 3,636
  • 4
  • 34
  • 45
26
votes
4 answers

Pack bits in a struct in C++ / Arduino

I have a struct: typedef struct { uint8_t month; // 1..12 [4 bits] uint8_t date; // 1..31 [5 bits] uint8_t hour; // 00..23 [5 bits] uint8_t minute; // 00..59 [6 bits] uint8_t second; // 00..59 [6 bits] } TimeStamp; but I would like…
Kent
  • 383
  • 3
  • 5