12
votes
Accepted
delay(time); vs if(millis()-previous>time); and drift
There's one important thing that you need to remember when working with time on an Arudino of any form:
Every operation takes time.
Your foo() function will take an amount of time. What that time is,...
10
votes
Newbie Using Brown Out detector on Arduino Due for saving variables to eeprom?
Not a good idea - if the power goes down when you writing to EEPROM, your EEPROM data will be corrupted. The brown-out detector goal is to shut off the MCU, before it goes mad due to low power voltage....
9
votes
Sizeof variables and Due's RAM
sizeof doesn't return the number of elements. It returns the number of bytes. Since they are uint16_t arrays each element is 2 bytes - hence twice the size.
The reason your last number is only 40928 ...
8
votes
Accepted
Faster Arduino Mega
You should begin working with 3.3V. 5V is getting rarer and rarer as far as "real world" applications go.
Many devices that you have been using at 5V will also work at 3.3V (such as the MAX22500E). ...
7
votes
Only getting error from ESP8266 AT commands
The AT firmware responded with ERROR because it received data, but timed out waiting for the CR/LF line ending.
AT commands must be terminated with Carriage Return '\r' and Line Feed '\n' control ...
6
votes
Accepted
How do I read from /dev/ttyACM0 in Linux without a terminal emulator?
I have had very similar problems with my yun(shields) and I found the stty command to be very crucial for a good working.
I use following command and it works with mega and due on the yun
stty -F ${...
6
votes
Accepted
Arduino Due vs Mega 2560
The 'R3' version boards and shields are compatible with 3.3V and 5V. For example the Ethernet Shield V1 version 'R3' can be used with the Due. The new Arduino Ethernet Shield 2 is also compatible with ...
6
votes
Accepted
Memory allocation on Arduino Due never returns NULL
Why
This is a partial answer, for now, mostly with regard to:
Why does malloc() never return NULL?
So, the Due appears to use Newlib as its libc implementation; that is the systems C (standard and ...
5
votes
Arduino Time Clock Accuracy
Re-visiting an old question... as I found a very informative blog post
that sheds new light into it. But let me first provide some context
before giving the link.
When assessing the quality of a time ...
5
votes
Arduino is not responding to a Tiny RTC I2C modules, How to fix?
You have a couple of problems (although the lack of pull-up resistors is not one of them, because the board you linked has pull-up resistors on it).
The DS1307 needs to operate at a minimum of 4.5 ...
5
votes
Arduino Due vs Mega 2560
The Due can do a lot of things much faster. It has more memory and far more processing power. It has more flexible and more powerful built-in peripherals.
It can't easily interface with 5V devices ...
5
votes
Accepted
How to enable exception handling on the Arduino Due?
First, we must make sure the "-fno-exceptions" compiler flag is overwritten with "-fexceptions". In addition, we must link a separate library that includes the compiler support ...
4
votes
Arduino due slow clock
The slow clockr is primarily used for the real time clock (RTC) module inside the SAM3X chip. It can also be routed to other places when you want a low speed clock source, but the only places it is ...
4
votes
Are DAC pins useful for anything besides working with audio?
They are incredibly useful. They are essentially how you deal with the analog world.
For example, I'm using two of them in a project here that uses a frequency generator and a couple of op-amps to ...
4
votes
Accepted
Arduino Due: Interrupt-based ADC hangs processing
In your interrupt handler, ADC_Handler(), you set sample_buffer_full when the buffer is full. I don't see anywhere in the code where sample_buffer_full ever gets reset (cleared) once it's been set.
...
4
votes
Accepted
Simultaneously reading data from multiple serial ports
My question here is how can I simultaneously read out all the data from the different serial ports on the arduino mega sketch.
As you are using several serial ports data can already be received ...
4
votes
Arduino onboard LED pin number as a constant
Try LED_BUILTIN:
pins_arduino.h:static const uint8_t LED_BUILTIN = 13;
4
votes
Accepted
4
votes
Accepted
Programming Arduino in Pascal?
Not Pascal, but Ada, which is much less restrictive than Pascal while enjoying the same advantages over low-level programming, and much more actively supported with language revisions as recently as ...
4
votes
Accepted
fatal error: avr/io.h: No such file or directory
The Due is SAM architecture. avr/io.h is specific to the AVR architecture of the Uno's microcontroller. The compiler will not look in the avr tools folder for that file and even if it did it wouldn't ...
4
votes
Sizeof variables and Due's RAM
The sizeof operator's result is number of bytes, not number of array elements. Your arrays in the program above have two bytes per element, hence twice as many bytes as elements.
If you want to ...
4
votes
Accepted
L and ON keeps blinking
You should split your problem in pieces. Like you cannot get communication with your Arduino again, so check first:
If you plug in the Arduino / USB, do you get a message on your computer?
Is it ...
4
votes
How to connect Arduino 5v pin with multiple things?
The simplest way is to just use a breadboard to connect your devices to your Arduino:
I can't read Chinese, so I can't check the specifications of these particular devices, but you need to be aware ...
4
votes
How to connect Arduino 5v pin with multiple things?
5V is just 5V. It's not a signal, it's just a voltage level. If you need to connect multiple things to it then just connect multiple things to it. If that means connecting wires together then so be it....
4
votes
Accepted
Digital Pins reads 1 when configured with internal_pullup
There is no difference between a switch and a "pin" for input. All are either HIGH or LOW. You tie it HIGH with the pullup, and then try giving it a HIGH with +5V (Caution: The Due is a 3.3V device, ...
4
votes
USB reset fails on arduino due because of 5v on digital pins
You're over-stressing the MCU and causing all sorts of horrible things to happen with the power rails. Of course nasty things are going to happen.
The only way to fix it is to change the circuitry. ...
4
votes
How to package a 16 bit integer to send it with serial.write?
Send the 16-bit value as two 8-bit values (with a start byte as per JRobert's answer):
Serial.write(0xCC); // Send the start byte
Serial.write((sensorVal >> 8) & 0xFF); // Send the upper ...
4
votes
SPI Slave Programming for Arduino
SPI.h library by default only support Master mode, the SPI.begin() will automatically set slave select (ss) pin to HIGH whether you have pinMode(ss, OUTPUT) in your setup() code or not and set the ...
4
votes
Accepted
How do I get the size of my program at runtime?
Just to warn you, I minimally tested this, but it seems to work.
In the Due's linker script there are these relevant lines, containing the named rom section.
MEMORY
{
rom (rx) : ORIGIN = ...
3
votes
Has anyone modified a 16x2 LCD shield to work with Arduino DUE?
I understand this is an 8yo thread, however my answer might still help someone.
I connected an unmodified no-brand LCD Shield to an Arduino DUE and it works perfectly - the only thing I had to change ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
arduino-due × 465serial × 55
arduino-uno × 34
spi × 30
programming × 23
arduino-mega × 21
interrupt × 19
usb × 18
arduino-ide × 17
sensors × 16
power × 15
i2c × 15
c++ × 14
shields × 14
arduino-nano × 11
timers × 11
adc × 11
communication × 10
sd-card × 10
flash × 10
pins × 9
pwm × 9
uart × 9
c × 8
analogread × 8