Most Popular

1500 questions
11
votes
3 answers

How to call C functions from Arduino sketch?

I would like to know if there is a way to call functions that are contained within C files using an Arduino sketch? My C file declares and defines a function. To save putting the messy function definition into my Arduino sketch, I'd like to call…
user_name
  • 317
  • 1
  • 3
  • 11
11
votes
4 answers

SAM3X8E (Arduino Due) Pin IO registers

How do the IO registers of Arduino Due work? On Arduino Uno just set DDRx, then PINx to read, PORTx to write, I'd like to do the same thing with an Arduino Due, but it has many more registers, such as PIO_OWER, PIO_OSER, PIO_CODR, PIO_SODR, etc. I…
Alex
  • 315
  • 1
  • 3
  • 9
11
votes
3 answers

Why are the pin numbers of the diagrams and of the code different?

If I search Google for "arduino nano pin numbers", all results show that the pin number of D2 is 5. But that did not work. I searched for some sample codes, and they were 3 for D3 and 5 for D5, etc. So, in codes, the pin number for Dn is n. Then…
Damn Vegetables
  • 357
  • 2
  • 9
11
votes
2 answers

3.3V, 5V and 9V pins on Arduino

On my Arduino Uno R3 and Arduino Mega R3, there are 5V and 3.3V pins. However on this page Introduction to the Arduino Board, there is a 5V and 9V pin but no 3.3V pin. The page at Arduino: What Adapter? also mentions a 9V pin. Why is there a…
Nyxynyx
  • 1,389
  • 4
  • 22
  • 25
11
votes
2 answers

Multiple .ino files in the same sketch

Yeah yeah, I know people ask this type of thing a lot, but I couldn't find an answer anywhere. I understand that you can have multiple .ino files in one sketch, but I don't just want functions and variables separated, I want functionality. I am…
Levi Lesches
  • 223
  • 1
  • 2
  • 6
11
votes
4 answers

avrdude ser_open() can't set com-state

When trying to upload the blink sketch to my (unofficial) Arduino Uno, I get the following error: avrdude ser_open() can't set com-state for "\\.\COM3" I have programmed this Arduino before using this same laptop, but not for quite some time. I…
rozzy
  • 213
  • 1
  • 2
  • 6
11
votes
7 answers

Does a delay in a loop save energy?

I've noticed most example snippets always have a delay in the loop even if it's not needed for proper execution of the program. I can only assume this is added because people copy and paste without understanding what's going on but it got me…
Ryan Detzel
  • 305
  • 5
  • 10
11
votes
3 answers

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 << TOIE1); All I know is that is has something to with…
The Guy with The Hat
  • 5,232
  • 7
  • 29
  • 51
11
votes
1 answer

What is the relationship of an Arduino .ino file to main.cpp?

Is the .ino file an alternative from a main.cpp file? If yes, then could someone mind explaining the structure of the .ino file in main.cpp and its relationship?
Lance
  • 123
  • 1
  • 1
  • 6
11
votes
2 answers

Cheap Wired Multipoint Mesh Network

I'm looking to make a 15 x 15 grid of load sensors and RGB LEDs for an interactive dance floor. Each node will be driven by an arduino and the entire floor will be managed by a RaspberryPi. I'm trying to figure out the best way to have the nodes…
Jeremy Gillick
  • 481
  • 1
  • 3
  • 8
11
votes
2 answers

What is the purpose of the I/O pin capacitor on the AVR microcontroller?

What is the purpose of the capacitor on the I/O pins on the ATmega328 (I imagine it's on other AVR microcontrollers as well)? Is it to reduce noise from other parts of the microcontroller?
lemontwist
  • 364
  • 4
  • 16
11
votes
3 answers

Major difference between DTR signal and RTS signal?

I actually had a doubt about what is the difference between the RTS signal and DTR signal ? I already know this that the DTR signal is used to auto reset when we use Arduino and similar MCUs. Can anyone say what is the major difference between these…
Sagnik Pradhan
  • 520
  • 1
  • 7
  • 17
11
votes
10 answers

Different ways (and the fastest) to compute sines (and cosines) in Arduino

I am using an Arduino Uno board to compute the angles of my system (robotic arm). The angles are actually 10 bit values (0 to 1023) from the ADC, using the full range of the ADC. I am only going to be operating in the 1st quadrant (0 to 90 deg),…
11
votes
3 answers

Why is my LCD 16*2 is not displaying any characters, although all the wiring is correct?

Recently I have linked up a typical 16*2 LCD (Liquid Crystal Display) display to my Arduino Uno and have linked all the pins up. Here is my connection:(LCD pin first) 1=GND, 2=+5v, 4=11, 6=12, 11=5, 12=4, 12=3, 14=2, 15=backlight positive,…
Stratmoss
  • 137
  • 1
  • 2
  • 6
11
votes
4 answers

Powering Arduino Uno from 5V pin, what exactly is the voltage range/tolerance?

I want to bypass the onboard regulator and use the 5V pin to feed arduino with external, regulated source. Everybody just keeps saying regulated 5V, but how precise does the regulation need to be exactly? Can you state a voltage range and what makes…
jediz
  • 217
  • 3
  • 7