Newest Questions
25,033 questions
11
votes
3
answers
4k
views
Could someone explain this weird looking code, used to setup timers?
While looking at sketches other people have written, I occasionally come across code that looks somewhat like this:
TCCR1A = 0;
TCCR1B = 0;
TCNT1 = 34286;
TCCR1B |= (1 << CS12);
TIMSK1 |= (1 &...
9
votes
5
answers
13k
views
How can an Arduino output a specific (i.e. 56 kHz) carrier frequency?
I'm working on a free space optics project to send data wirelessly between two points. To accomplish this I'm using an IR LED connected to an Arduino Uno that pulses with a 56 kHz carrier ...
5
votes
3
answers
3k
views
Why does my sketch report too many button presses?
I've been using a button to interact with a sketch (on my Uno), and it's mostly working fine. However, sometimes it seems to be detecting multiple presses when it's only pressed once.
It's a small ...
21
votes
4
answers
8k
views
How can higher current devices (motors, solenoids, lights, etc.) be controlled by an Arduino?
I'm looking for a broadly applicable solution, one that can be adapted to a variety of projects.
I'm currently working on several projects that each require controlling devices ranging from 800mA to ...
13
votes
8
answers
6k
views
Where can I find a central repository of all available Arduino libraries?
Currently; when I start a new Arduino project with some new hardware, the first thing I do is to look for 3rd-party libraries that bring Arduino support for this hardware.
The first places I look are:...
3
votes
1
answer
963
views
How can I use Python from a sketch?
I'd like to be able to use Python from a sketch. According to the Arduino playground, one can use PySerial from a computer to talk with an Arduino via Python.
It looks like from that page you can ...
22
votes
5
answers
8k
views
How much can I recurse? How much can I recurse? How much ca!@#QFSD@$RFW
The Arduino Uno board has limited RAM which means it has a limited call stack available. Sometimes, recursion is the only quick option to implement a certain algorithm. So, given that the call stack ...
3
votes
1
answer
6k
views
How can I rename how my Arduino shows up on the computer?
I have a clone of a Mega 2560, and the Chinese manufacture apparently had a broken shift key. To my annoyance, whenever I connect it to my computer it reads, arduino compatible mega 2560. With my ...
92
votes
7
answers
60k
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 ...
14
votes
4
answers
17k
views
Why do sketches take up so much space and memory?
When I compile this sketch for the Yún:
int led = 7;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH);
}
I get:
Sketch uses 5,098 bytes (17%) ...
6
votes
2
answers
643
views
Logging multiple gigabytes of data with Arduino
I have Arduino Uno with SD card shield. I'm planning to log a huge amount of data from various sensors - including accelerometers and 3D compass - to the SD card.
However, I have understood that ...
4
votes
3
answers
6k
views
SMPTE Timecode Reader with LCD display coding question
I've managed to adapt some code from the Arduino forums to display timecode on an LCD display.
What I would like some extra help with is first is there a way of defining the one_time_max etc ...
21
votes
2
answers
13k
views
Would an infinite loop inside loop() perform faster?
When you're writing a typical sketch, you usually rely on loop() being called repeatedly for as long as the Arduino is running. Moving in and out of the loop() function must introduce a small overhead ...
10
votes
1
answer
4k
views
Controlling water temperature accurately
I have following setup:
Arduino Duemilanove
Small water heater connected with optical relay (PWM is ok)
Waterproof DS18B20 temperature sensor
Unknown amount of water (but temperature sensor and heater ...
6
votes
1
answer
2k
views
Can a stepper motor be controlled directly from an Arduino?
I'm planning to build a simple XY plotter, and have been looking at the possibility of using a pair of small 5V 4-phase steppers to provide the movement. In my research, I've often seen stepper driver ...