Most Popular
1500 questions
9
votes
2 answers
Does millis() conflict with the PWM pins associated with timer 0?
I've read that the millis() function uses the same timer as a couple of PWM pins.
If you're using those PWM pins, will millis() still return the correct value?
Aurast
- 295
- 2
- 7
9
votes
5 answers
Reasons why it is not OK to connect a relay directly from an Arduino digital pin
After looking into various schematics on controlling a relay via an Arduino, I have noticed that, most of the time, transistors are used to switch the separate supply into the relay coil rather than directly supplying the relay with the 5-Volt…
DorkOrc
- 145
- 3
- 3
- 10
9
votes
2 answers
Use Higher Resistance Than Instructed in a Circuit
I'm following the "Get Started with Arduino" Guidebook, and I'm at the part where pulse width modulation (PWM) is discussed.
The instructions say to create a simple circuit with a breadboard, red LED, arduino (connected at pin 9 and ground) and a…
Neuron
- 93
- 1
- 4
9
votes
2 answers
Allocate object memory statically; intialize it dynamically?
I have an object whose constructor gets passed a parameter. If I know the parameter value at compile time, I can construct the object statically:
static FOOOBJ foo(3);
(I understand that it isn't really done statically, i.e. by the compiler, but is…
JRobert
- 15,397
- 3
- 24
- 51
9
votes
6 answers
Uploading a simple sketch takes forever
I am trying to upload this simple sketch into my arduino with a shield I made. It takes forever (note I have the right COM port on)
int sensorValue = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
sensorValue =…
Diana Lc
- 125
- 1
- 2
- 6
9
votes
3 answers
How to write makefile-compatible sketches?
I'd like to write my sketches so that I can either build/upload them using the Arduino IDE, or optionally using GCC and a makefile.
I know about including the function declarations at the top, but is there anything else to do in order for my sketch…
Alex Shroyer
- 437
- 2
- 5
- 9
9
votes
1 answer
How can the Arduino Uno support up to 12 servos if it only has 6 digital PWM pins?
According to this:
The Servo library supports up to 12 motors on most Arduino boards and
48 on the Arduino Mega. On boards other than the Mega, use of the
library disables analogWrite() (PWM) functionality on pins 9 and 10,
whether or not…
user1265
- 93
- 1
- 3
9
votes
2 answers
RFID/NFC (13.56 MHz), is it possible to send raw bytes and receive response?
I'm trying to implement a card reader (i.e. credit cards) for shopping purposes, and AFAIK those cards are ISO 14443-A compliant (Mifare Classic 1K). I already made an Android app that can send custom APDU to read specific sectors by using raw…
TheAverageGuy
- 91
- 2
9
votes
2 answers
Servo won't stop rotating
I have an Arduino Uno R3 board and after some time not in use it seems to have corrupted. My code is below, basically I want to rotate a servo 90 degrees every 12 hours but as soon as I plug it in the servo starts rotating non-stop. Have tried…
Stedy
- 193
- 1
- 1
- 6
9
votes
3 answers
How to read pinMode for digital pin?
Is there a way for me to read the pin mode for one of the digital pins on Arduino? In other words, can I determine whether a pin's been set to an input or output?
John
- 213
- 2
- 4
9
votes
1 answer
Is there any way to run binary code from RAM?
I am looking for an inexpensive single board computer that I could program in assembly language, using limited facilities to load the object code from a PC and simple I/O peripherals.
Ideally I would like to be able to write in a reasonable time all…
pierre
- 91
- 2
9
votes
2 answers
What maximum length of wire can I use to connect a push button to an Arduino?
I am trying to get 8 stop buttons to cause an Arduino UNO to activate a single relay!
The stop buttons have been placed 30' to 250' away from the Arduino uno board.
Q: How far can you go with 5v and still get signal back?
Q: Is there a way to…
The Earl
- 111
- 1
- 1
- 3
9
votes
7 answers
How to remember variable values after rebooting an Arduino Uno R3 board?
Is there any way to store the values of necessary variables somewhere (may be in a file that gets updated by the program at various events), which can be read back when program starts after rebooting the Arduino board?
I am trying to control my AC…
Samik Chattopadhyay
- 235
- 2
- 3
- 6
9
votes
2 answers
Arduino at 20 MHz?
I wonder why Arduino doesn't run at 20 MHz, the frequency the AVR is specified for. Now, running at 16 MHz, we're wasting 20% performance for nothing.
I don't think there are any implications when you replace the 16 MHz resonator with a 20 MHz…
Joris Groosman
- 1,191
- 3
- 11
- 26
9
votes
1 answer
Overview of compiled code size
When I compile my code, the Arduino IDE returns the binary sketch size in byte.
Is there a good way to find out (approximately) what function or what part of my code takes up how much memory in flash, so that I get a feeling what feature takes most…
fuenfundachtzig
- 1,535
- 1
- 14
- 26