Most Popular
1500 questions
9
votes
2 answers
memory usage "dos and don'ts"
Though I've written C/C++ code for a long time, the unseen limitations on how memory was consumed on various MCU and SOC programming platforms have often tripped me up. As I'm about to build up code for my first large project for my NANO boards,…
Randy
- 407
- 3
- 13
9
votes
1 answer
Resistor pull-ups for ESP8266
I'm using 4.7kOhm resistor as pullups for GPIOs 2,0,2,16, CH_PD and RESET, and also 4.7kOhm pulldown for GPIO 15. The ESP8266 boots and works fine. Would it be okay for a long shot? Should I use 10kOhm instead of 4.7kOhm?
JFetz2191
- 155
- 1
- 2
- 7
9
votes
1 answer
Why connect a diode between the reset pin of Arduino and 555 timer?
I am trying to create a watchdog timer using 555 IC and I am following this.
I do not understand why a 1N4148 diode is connected between the reset pin of Arduino and the output of the 555 timer.
As far as I understand, the reset pin of the Arduino…
bukke hari prasad
- 159
- 1
- 1
- 6
9
votes
2 answers
How can I pass an object as a parameter to a function?
I am making a tiny game, and want to store high-scores. I made a Highscore-class in the top of the sketch file, like this:
class Highscore {
public:
String name;
int score;
String toString() {
return this->name + " - " + (String)score;
…
krystah
- 195
- 1
- 2
- 6
9
votes
1 answer
SPI Arduino Due conflict with pinMode(), bug?
Consider the following minimal example, where I set pinMode before calling SPI functions:
#include
void setup() {
pinMode(10, OUTPUT);
SPI.begin(10);
SPI.setDataMode(10,SPI_MODE1);
}
void loop() {
delay(1000);
…
newandlost
- 223
- 1
- 4
9
votes
9 answers
Best way to determine if a 5 gallon water jug is getting empty
I have an espresso machine that gets its water from one of those 5 gallon blue water bottles (I would plumb it, but our water here is WAAAAY too hard).
If I ever accidentally let the bottle run out of water, the rotary pump in the espresso machine…
synic
- 203
- 2
- 6
9
votes
3 answers
delay(time); vs if(millis()-previous>time); and drift
Going through an old project, I had code on two Arduino Due that looked like this
void loop()
{
foo();
delay(time);
}
taking to heart the majority of literature on using delay(); I recoded this as
void loop()
{
static unsigned long PrevTime;
…
ATE-ENGE
- 931
- 3
- 19
- 32
9
votes
4 answers
How do functions outside of void loop work?
I am used to Arduino sketches with a void setup() part that runs once, and a void loop() part that keeps looping. What happens when you have void functions outside of the main void loop()? Will these all keep looping in parallel or do they run one…
Blue7
- 245
- 3
- 4
- 8
9
votes
3 answers
PROGMEM: do I have to copy data from flash to RAM for reading?
I have got some difficulties understanding the memory management.
Arduino documentation says, it is possible to keep constants like strings or whatever I don't want to change during runtime in program memory. I think of it as embedded somewhere in…
Ariser
- 577
- 1
- 7
- 25
9
votes
3 answers
Only 2 decimal places in printed float
There was a similar thread before but it didn't solve my problem. I had an issue with sending GPS data, which is float, and I couldn't receive the float with the same amount of significant figures as I was sending. I always received a number with 2…
Anthropomorphous Dodecahedron
- 233
- 1
- 3
- 8
9
votes
1 answer
How can a 5v Uno talk to a 3.3v Due?
I currently have an Uno (which operates at 5v), and I'm looking at buying a Due (which only operates at 3.3v). I'd like to make them communicate via Serial or SPI or similar, but presumably connecting them directly isn't an option (I guess the Due's…
Peter Bloomfield
- 10,932
- 9
- 47
- 87
9
votes
5 answers
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 frequency for the transmitter and a second Arduino with a…
jlbnjmn
- 978
- 2
- 9
- 15
9
votes
2 answers
Difference between SoftwareSerial and Serial
From the sample code
#include
SoftwareSerial mySerial(10, 11); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(57600);
while (!Serial) {
; // wait for serial port to…
Siddharth
- 245
- 2
- 4
- 12
9
votes
2 answers
Why does an Arduino UNO need two GND ports?
I have really bad eyesight, so whenever I plug in the power wire and the GND wire I always double check if I'm actually plugging in to the power port not one of the two GND ports.
Why does an Arduino UNO have two GND ports, and for what application…
Fraïssé
- 895
- 5
- 13
- 16
9
votes
6 answers
Very long delay() possible?
I'm trying to make an opening and closing little door that should open or close every 12 hours. I was wondering if I could just make a small looping script with a delay() for 12 hours, delay(43 200 000 000); I guess? However, I have no idea if…
Fred Pannekoek
- 93
- 1
- 1
- 5