Questions tagged [arduino-leonardo]

An Arduino board based on the ATmega32u4 chip with built in USB HID functionality

334 questions
67
votes
2 answers

How do you use SPI on an Arduino?

With reference to the Arduino Uno, Mega2560, Leonardo and similar boards: How does SPI work? How fast is SPI? How do I connect between a master and a slave? How do I make an SPI slave? Please note: This is intended as a reference question.
Nick Gammon
  • 38,901
  • 13
  • 69
  • 125
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
10
votes
3 answers

Upload code on Arduino Leonardo using command line

I'm trying to upload a compiled .hex file on an Arduino Leonardo, using the terminal. Uploading a sample code using the Arduino IDE works well, and from the Arduino IDE I got the upload command avrdude -C/etc/avrdude.conf -patmega32u4 -cavr109 -v -v…
Alex
  • 315
  • 2
  • 3
  • 9
10
votes
4 answers

How to really shrink a sketch

I want to make a sketch that is as small as possible, for test purposes. The problem is, when i compile the BareMinimum sketch (with an empty setup and loop), i get 466 bytes for the Uno and a whopping 4,242 for the Leonardo. Is there any way to…
TheDoctor
  • 3,509
  • 1
  • 22
  • 39
8
votes
4 answers

Leonardo (32u4): ways to brick it programmatically

When the Leonardo was introduced, I think, I've read some articles about being cautious to do some things, that could cause it to not load any new sketches any more, so one has to rewrite the bootloader. Because I plan to use power-saving options,…
Thomas S.
  • 566
  • 3
  • 8
  • 21
7
votes
3 answers

Multiple SPI device

I want to connect Ethernet board (W5100 HR911105A) to Arduino Leonardo with SPI and I also want to connect SD reader. When I test these boards separately everything working. But when I connect them on the same board the program fails at…
eszik.k
  • 121
  • 5
6
votes
3 answers

How can I filter out noise from ADC lines without delay or signal change?

I'm working on a project with a joystick and I'm trying to keep everything a simple and low latency as possible. I am reading the pots with the onboard 10bit ADC on the ATmega 32u4 but may be upgrading to either a 16bit ADC or 24 bit ADC. How can I…
user862
  • 71
  • 1
  • 1
  • 2
6
votes
2 answers

A question about resistance measurement with arduino

Lately I was asking myself about the possibility of measuring a potentiometer resistance with Arduino. My questions are: Is it possible? If it's possible, what kind of restriction does the Arduino have with the resistance value measured?
6
votes
1 answer

Programmatically Upload Arduino Sketch From Android App

I am attempting to build an Android app from which I can can upload a .hex file to my Arduino(Leonardo). I am aware of a few apps in the Google Play store that are capable of this functionality but I can't seem to find any actionable resources on…
Karoly S
  • 281
  • 2
  • 7
5
votes
4 answers

Where in datasheet is the warning about unreliability of reading PINxn?

I use atmega32u4 (but believe it applies to all models). Here is the datasheet. Consider the following C program (I use AVR-GCC 5.4.0): #include int main(void) { PORTB |= 1 << PB5; /* pullup */ DDRB |= 1 << PB0; /* LED */ if (!(PINB…
5
votes
4 answers

Library to set internal analog gain of the Arduino?

My original question was if there is a library that covers the internal comparator and differential and gain modes for the Arduino Uno, Mega 2560, Leonardo, Due, Zero, M0. The answer is obvious: "No". To my surprise there is not even a start to make…
Jot
  • 3,276
  • 1
  • 14
  • 21
5
votes
2 answers

Arduino Leonardo timing Inconsistency

I've got a question regarding the use of Millis() on a Leonardo Arduino. I'm currently using it to time 4 seconds elapsed while sending a serial message every second. These messages play a sound. On the fourth message the sound is different to…
Karoly S
  • 281
  • 2
  • 7
5
votes
2 answers

Practicality of recording speech

Is it practical to record speech with the Leonardo? I want to record speech via a MEMS microphone and stream it over a serial connection to a Raspberry Pi for speech-to-text processing. This article states that the typical bitrate for recording…
Cerin
  • 1,688
  • 2
  • 28
  • 45
5
votes
1 answer

Can I speed up the Leonardo bootloader?

Inspired by an example question before beta, can I make the Leonardo bootloader take less that 8 seconds to run? It is very slow and I want to speed it up somehow.
TheDoctor
  • 3,509
  • 1
  • 22
  • 39
5
votes
1 answer

IR frequency difference

I want to create a device that interfaces with the Light Strike Lasertag system using an Arduino Leonardo. The Light Strike system uses not laser but regular infrared signals. According to a site that I found…
Dakkaron
  • 239
  • 1
  • 10
1
2 3
22 23