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
26
votes
9 answers

Eclipse C/C++ Shows Errors but Compiles?

So I am building some Arduino code in eclipse, as described in Your Second Arduino Project, but every time I use an Arduino library, such as Serial, Eclipse underlines my function names, claiming they cannot be resolved. However, the code actually…
SuperTron
  • 4,203
  • 6
  • 35
  • 62
25
votes
2 answers

How can I properly connect an Android application to an RFCOMM socket on a Bluetooth enabled Arduino microcontroller?

I'm working with some students at my university developing a simple Bluetooth Android application that will be used for serial communication (RFCOMM) to an Arduino microcontroller with a Bluetooth module connected to it. To the best of my knowledge,…
Joey Carson
  • 2,973
  • 7
  • 36
  • 60
25
votes
4 answers

Converting struct to byte and back to struct

I'm currently working with Arduino Unos, 9DOFs, and XBees, and I was trying to create a struct that could be sent over serial, byte by byte, and then re-constructed into a struct. So far I have the following code: struct AMG_ANGLES { float yaw; …
Steven10172
  • 2,003
  • 4
  • 21
  • 37
24
votes
5 answers

Arduino IDE (Win10) crashes when I launch the program

My Arduino IDE (ver 1.8.12 on Win10) crashes when I launch it. Running the arduino_debug.exe I get this error message. C:\Program Files (x86)\Arduino>arduino_debug.exe Set log4j store directory C:\Users\volke\AppData\Local\Arduino15 Loading…
Volker Petersen
  • 283
  • 2
  • 8
24
votes
9 answers

Calculating daylight saving time from only date

I am working with an Arduino and a real time clock chip. The chip compensates for leap years and such, so it will always have the correct date, but it does not handle daylight saving time, I assume due to regional complications. The clock can give…
Muggz
  • 243
  • 1
  • 2
  • 5
24
votes
3 answers

python to arduino serial read & write

I'm trying to "ping pong" info back and forth between some python code and arduino code. I want to send two setpoints to the arduino code periodically (for instance on the minute), read them on arduino & update variables then send status info from…
Boombrewer
  • 245
  • 1
  • 2
  • 5
24
votes
6 answers

Bluetooth mesh networking?

I had an Idea and I was wondering if it was possible. I've googled it and can't seem to find any existing solutions. I was thinking of having a Bluetooth mesh network. The layout I was hoping to achieve is to have one central station (PC with…
24
votes
5 answers

Arduino HIGH LOW

I have an Arduino and I am wondering exactly what HIGH and LOW mean, as far as actual values go... Are they signed ints? unsigned ints? unsigned chars? What are their values? I am guessing that HIGH and LOW are probably unsigned ints with all of the…
Void Star
  • 2,401
  • 4
  • 32
  • 57
23
votes
3 answers

Kill process that raises Device or resource busy: '/dev/ttyUSB0'?

I connect to my Arduino board with the following Python code. device=glob.glob("/dev/ttyUSB*")[0] time.sleep(1) arduino = serial.Serial(device, 115200, timeout=5) It generally works, but somehow some other process must be accessing the board after…
birgit
  • 1,121
  • 2
  • 21
  • 39
23
votes
5 answers

Transform char array into String

I have a function that returns a char array and I want that turned into a String so I can better process it (compare to other stored data). I am using this simple for that should work, but it doesn't for some reason (bufferPos is the length of the…
FloIancu
  • 2,685
  • 8
  • 29
  • 34
23
votes
11 answers

Does Arduino support threading?

I have a couple of tasks to do with arduino but one of them takes very long time, so I was thinking to use threads to run them simultaneously. I have an Arduino Mega [Update] Finally after four years I can install FreeRTOS in my arduino mega. Here…
Snake Sanders
  • 2,641
  • 2
  • 31
  • 42
23
votes
10 answers

pyserial - How to read the last line sent from a serial device

I have an Arduino connected to my computer running a loop, sending a value over the serial port back to the computer every 100 ms. I want to make a Python script that will read from the serial port only every few seconds, so I want it to just see…
Greg
  • 45,306
  • 89
  • 231
  • 297
23
votes
7 answers

Android + Arduino Bluetooth Data Transfer

I can get my Android app to connect via Bluetooth to my Arduino. However no data can be transmitted between them. Below is my setup and code: HTC Android v2.2, Bluetooth mate gold modem, Arduino Mega (ATmega1280) Android Java code: package…
Backwards_Dave
  • 509
  • 1
  • 6
  • 12
23
votes
3 answers

try/catch block in Arduino

I am working with socket communication in Arduino, and I need the try/catch block for proper handling, what do you guys suggest? My search on the internet wasn't successful. edit: The code I am working with uses the WiFly module to interact with a…
NZal
  • 849
  • 3
  • 9
  • 19
22
votes
4 answers

Making a http POST request using Arduino

I am trying to post information to an API on a web project that I have created and hosted. I am not sure what the exact format is for the HTTP POST request. Every time I try I get HTTP 400 errors with the message that there is "an invalid…
Austen Bryan
  • 229
  • 1
  • 2
  • 3