Most Popular
1500 questions
18
votes
5 answers
How can I declare an array of variable size (Globally)
I'd like to make three arrays of the same length. According to the documentation, Arrays must be defined as int myArray[10]; where 10 can be substituted for a known length (another integer), or filled with an array {2, 3, 5, 6, 7}.
However, when I…
user3.1415927
- 283
- 1
- 2
- 5
18
votes
2 answers
When should I use a transistor, mosfet, and when should I use a relay?
I am used to relays some, and they are useful, especially for large loads like a incandescent light bulb or other 120V AC device. However, it seems like overkill to use a relay for a bunch of LEDs linked together (parallel) that use 60 mA (too much…
Anonymous Penguin
- 6,155
- 9
- 31
- 62
18
votes
5 answers
How do I get an accurate time?
I've made a clock using an Arduino, but the time seems to drift. I am aware of the rollover issue; the clock seems to drift by about 15 minutes over the course of a week.
I'm using a custom PCB with this resonator from Digi-key. The code reads the…
John Walthour
- 303
- 3
- 8
18
votes
4 answers
Are there any signal smoothing libraries for Arduino?
I am working on a mobile robot controlled via a wireless 2.4 GHz link.The receiver is connected to the Arduino Uno which serves onboard as the main controller. The most critical (and main) input channel coming from the receiver produces a very noisy…
asheeshr
- 3,687
- 3
- 24
- 61
18
votes
1 answer
How does serial communications work on the Arduino?
With reference to the Arduino Uno, Mega2560, Leonardo and similar boards:
How does serial communications work?
How fast is serial?
How do I connect between a sender and receiver?
Please note: This is intended as a reference question.
Nick Gammon
- 35,792
- 12
- 63
- 121
18
votes
5 answers
deprecated conversion from string constant to 'char*'
What does this error means?
I can't solve it in any way.
warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
Facorazza
- 421
- 2
- 6
- 17
18
votes
4 answers
How to get weight data from glass electronic bathroom scale sensors?
I am doing a small project with a bathroom scale but I run into some problems. I am using an Arduino Uno V3, HX711 module amp and a scale.
Scale:
HX711 amplifier:
I disassembled the scale to get to sensor wires and I am a bit confused. These…
silent_bob
- 193
- 1
- 2
- 7
17
votes
6 answers
How can Arduino source code be tested automatically (continuous integration)?
I'd like manage my Arduino source code (projects and libraries) under source control with continuous testing. How can I automatically compile the code with continuous integration tools, to make sure each version compiles cleanly? In the best case…
Jakob
- 273
- 2
- 7
17
votes
3 answers
What is the best way to unit test my code without controller?
I want to unit test my Arduino code. Ideally, I want to execute and test my code without uploading it to the board. What tools or libraries can help me with this?
There is an Arduino emulator in development which could be useful, but it doesn't yet…
Hardik Thaker
- 1,377
- 1
- 11
- 15
17
votes
1 answer
How do I convert a float into char*?
Asked this question on Electrical Engineering Stack Exchange and was directed here:
Pretty self explanatory; how would I go about converting a float into a char*? I have code in which the float 'resistance' is constantly being updated. I would like…
higgsboson
- 173
- 2
- 2
- 6
17
votes
5 answers
What happens if there is a runtime error?
What happens if there is a runtime error in a program? Will execution of the program just stop? Is there some way I can get the Arduino to tell me what the error is?
The Guy with The Hat
- 4,962
- 7
- 28
- 51
17
votes
2 answers
What happens when I call exit() from my program?
In either of setup or loop, if I were to add an exit(0) call, where would control be passed to? What would the next state of the microcontroller be? Would it stop execution and power down?
I am using a revision 2 Arduino Uno.
asheeshr
- 3,687
- 3
- 24
- 61
16
votes
3 answers
Is there a color LCD display for an arduino?
I currently have a Mega2560 with the LCD4884 Shield. The Shield is good for putting out text and simple pixel images. But I am wondering if there is something that has a full range of colours that would work with the Arduino? The screen size would…
Ryan Erb
- 263
- 3
- 7
16
votes
6 answers
How can I get the source files for Arduino libraries?
I've been looking for a while inside Arduino's files to find the core library. However, I haven't found them yet. Where on my hard drive can I obtain the core library files (.cpp and .h) necessary for all Arduino code?
Looking around on Google, I…
Anonymous Penguin
- 6,155
- 9
- 31
- 62
16
votes
7 answers
How do I know the sampling frequency?
I am beginning to get a bit confused about sampling rates and baudrates etc. I have this Arduino code:
#include
extern volatile unsigned long timer0_overflow_count;
float fanalog0;
int analog0;
unsigned long time;
byte…
hawkar
- 513
- 2
- 6
- 11