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
55
votes
5 answers

Convert a String to a byte array and then back to the original String

Is it possible to convert a string to a byte array and then convert it back to the original string in Java or Android? My objective is to send some strings to a microcontroller (Arduino) and store it into EEPROM (which is the only 1  KB). I tried to…
Eng.Fouad
  • 115,165
  • 71
  • 313
  • 417
51
votes
10 answers

Looking for ways for a robot to locate itself in the house

I am hacking a vacuum cleaner robot to control it with a microcontroller (Arduino). I want to make it more efficient when cleaning a room. For now, it just go straight and turn when it hits something. But I have trouble finding the best algorithm or…
Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261
51
votes
3 answers

python3 pySerial TypeError: unicode strings are not supported, please encode to bytes:

In Python 3 I imported the pySerial library so I could communicate with my Arduino Uno by serial commands. It worked very well in Python 2.7 but in Python 3 I keep running into a error it says this TypeError: unicode strings are not supported,…
Nik Hendricks
  • 543
  • 1
  • 4
  • 9
50
votes
10 answers

Keeping all libraries in the Arduino sketch directory

I know that you are supposed to place any external libraries under the "libraries" folder of the arduino install directory, but I have a project that uses several libraries that I have created for the project and mainly to keep all that code self…
Adam Haile
  • 30,705
  • 58
  • 191
  • 286
48
votes
13 answers

Command line Arduino compiling and uploading?

How do I compile and upload Arduino sketches from the command line on Mac and Linux? I've installed the Arduino programming environment. Are there some sample makefiles anywhere?
Mark Harrison
  • 297,451
  • 125
  • 333
  • 465
44
votes
5 answers

How to unpair or delete paired bluetooth device programmatically on android?

The project is to use my android phone to connect with my arduino devices. but how can I unpair the paired ones. I see it seems the paired list is stored where bluetoothadapter could retrieve anytime. PS: 1st, I know long press paired device will…
Dev Perfecular
  • 1,413
  • 1
  • 11
  • 14
44
votes
7 answers

How to find the serial port number on Mac OS X?

I have just started experimenting with Serproxy and Arduino to get some serial data into Flash Builder/Flex. Serproxy seems to work fine and seems to connect to whatever port is specified. However, I am not able to see or read any data from the…
Bob-ob
  • 1,560
  • 4
  • 18
  • 34
38
votes
15 answers

avrdude: stk500v2_ReceiveMessage(): timeout

This is the main error that I get when I try to run my ARDUINO program. The full list of errors is as follows: avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage():…
nattynerdy
  • 411
  • 1
  • 5
  • 9
38
votes
6 answers

Using classes with the Arduino

I'm trying to use class objects with the Arduino, but I keep running into problems. All I want to do is declare a class and create an object of that class. What would an example be?
user29772
  • 1,457
  • 7
  • 21
  • 25
37
votes
3 answers

How do you debug Arduino code running on Arduino hardware?

Is there a way to set source-level breakpoints, run the code on actual hardware, and be able to inspect variables and continue?
user122299
37
votes
14 answers

Does it matter which microcontroller to use for 1st time embed system programmer?

I've experience in doing desktop and web programming for a few years. I would like to move onto doing some embed system programming. After asking the initial question, I wonder which hardware / software IDE should I start on... Arduino + Arduino…
Henry
  • 32,689
  • 19
  • 120
  • 221
36
votes
7 answers

Where are the hex files compiled by Arduino?

Where does the Arduino IDE save the binaries on Mac OS X?
IAmNaN
  • 10,305
  • 3
  • 53
  • 51
34
votes
2 answers

How to program an Arduino with C++

So lately I've been playing around with my Arduino and I was wondering if there was some way I could program the Arduino in C++. I've been programming it using the C++/Processing language in Vim and using a makefile to compile and upload to the…
Michaelslec
  • 905
  • 1
  • 9
  • 20
33
votes
11 answers

How can I digitalRead a pin that is in pinMode OUTPUT?

I have a very simple test sketch in which I'm trying to set a pin to HIGH and then read its state with digitalRead. Here is my sketch. void setup() { Serial.begin(9600); } void loop() { delay(1000); pinMode(3, OUTPUT); …
Bazzz
  • 26,427
  • 12
  • 52
  • 69
33
votes
3 answers

Arduino Due HTTPS Support

In previous versions of Arduino, the limiting 8-bit microcontroller board, it seems that implementing HTTPS (not merely HTTP) was almost impossible. But the newer version of Arduino Due provides 32-bit ARM core - see spec here. I tried to check…
Guy
  • 12,388
  • 3
  • 45
  • 67