Most Popular

1500 questions
23
votes
2 answers

Reset an Arduino Uno in code

Is it possible to reset an Arduino (i.e., to reboot it) from code (i.e from the sketch itself)? I know that is possible with a special circuit but is there a chance to make it just with code? Below is my code and the comment //reset is where I want…
kimliv
  • 561
  • 1
  • 4
  • 17
22
votes
4 answers

What is the maximum power consumption of the Arduino Nano 3.0?

What is the maximum power consumption (in mW) of the Arduino Nano 3.0, when it is running in its default state (at 16MHz, no LEDs removed) and powered by an external regulated 5V supply so it bypasses the built in voltage regulator? This will give…
Nyxynyx
  • 1,419
  • 4
  • 23
  • 25
22
votes
2 answers

Is there a limit on how much current a pin can sink?

I've been experimenting with an 8x8 LED matrix controlled by an Arduino Uno. As I think is typical, the matrix uses a common anode for each row, and a common cathode for each column. At the moment, I've got all the matrix pins connected directly to…
Peter Bloomfield
  • 10,982
  • 9
  • 48
  • 87
22
votes
10 answers

How to identify Arduino Mini Pro 5v vs 3.3v

I have many Arduino Mini Pro, every from different seller. Few are 3.3v and most 5v. I had to clean table for Xmas and now I do not have any idea how to identify 3.3v Arduinos. They do not have any marks. I bought them on ebay. I know 3.3v has 8mhz…
Max
  • 323
  • 1
  • 2
  • 5
22
votes
1 answer

How to access multiple SPI interfaces on Arduino

I have worked on SPI devices connected with an Arduino one at a time. How do I work with two different SPI devices at the same time?
22
votes
5 answers

What overheads and other considerations are there when using a struct vs a class?

C on embedded systems has traditionally use structs to hold structured data. Arduino brings C++ to the table, so we can use classes instead. Lets say we have two different data structures which could be considered very similar: typedef struct { …
Cybergibbons
  • 5,420
  • 7
  • 34
  • 51
22
votes
2 answers

Can two LEDs attached to different pins share their resistor?

I'm designing an Arduino style board with built-in LEDs for several of the pins. To simplify assembly of the board and save on components, I was wondering whether it would be safe for those LEDs to share a single resistor, as in this…
microtherion
  • 1,512
  • 9
  • 19
22
votes
5 answers

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 is severely limited, what would be a way to find…
asheeshr
  • 3,847
  • 3
  • 26
  • 61
22
votes
3 answers

Can a function be called automatically when an input changes?

Currently, my sketch is checking an input pin every time round the main loop. If it detects a change, it calls a custom function to respond to it. Here's the code (trimmed down to the essentials): int pinValue = LOW; void pinChanged() { …
Peter Bloomfield
  • 10,982
  • 9
  • 48
  • 87
22
votes
2 answers

What's the difference between a clone and a counterfeit Arduino?

I've been hearing a lot about clones and counterfeits. What are the differences between the two?
Anonymous Penguin
  • 6,365
  • 10
  • 34
  • 62
22
votes
4 answers

Can ESP8266 replace Arduino?

I’m a hobbyist and have used Arduino so far for simple projects. Now I want to build a project involving addressable LEDs, I want to write several programs on the Arduino for the LEDs and on my phone I select which ones to run. I found ESP8266 as a…
ahmadx87
  • 549
  • 2
  • 9
  • 16
22
votes
2 answers

Why do some pins have a different PWM frequency?

According to the Arduino reference for analogWrite(), the PWM frequency on most pins is ~490 Hz. However, it's ~980 Hz for pins 5 and 6 on the Uno, and for pins 3 and 11 on the Leonardo. Why are these different? Is it a deliberate design feature, or…
Peter Bloomfield
  • 10,982
  • 9
  • 48
  • 87
22
votes
2 answers

Why can't I declare a class in another tab in Arduino IDE?

I wanted to move some of my code out into a second tab in the Arduino IDE, to keep things better organised. At first, I only tried moving a function, and it seemed to work fine. I could call the function from the setup() function in my main tab, and…
Peter Bloomfield
  • 10,982
  • 9
  • 48
  • 87
22
votes
3 answers

How to check my Arduino board is working or dead?

When you have a board in your hand but you don't know is it working or not, how to verify if it's working or dead?
Hardik Thaker
  • 1,407
  • 2
  • 12
  • 15
21
votes
7 answers

Loading local libraries

I'm new to Arduino/C development (coming from a JavaScript/Ruby environment), but I was wondering if it was possible to include a library from a custom folder within a sketch? So this is my situation; project.ino libs/ MyNewLib/ MyNewLib.h …
Stefan
  • 311
  • 1
  • 2
  • 6