Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [arduino-leonardo]

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

Filter by
Sorted by
Tagged with
67 votes
2 answers
226k views

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: ...
Nick Gammon's user avatar
  • 38.3k
22 votes
2 answers
27k views

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 ...
Peter Bloomfield's user avatar
10 votes
3 answers
10k views

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 ...
Alex's user avatar
  • 315
10 votes
4 answers
9k views

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 ...
TheDoctor's user avatar
  • 3,469
8 votes
4 answers
2k views

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 ...
Thomas S.'s user avatar
  • 566
7 votes
3 answers
1k views

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 ...
eszik.k's user avatar
  • 121
6 votes
2 answers
11k views

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 ...
Julio Orozco's user avatar
6 votes
3 answers
14k views

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 ...
user862's user avatar
  • 71
6 votes
1 answer
1k views

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 ...
Karoly S's user avatar
  • 281
5 votes
4 answers
214 views

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 <avr/io.h> int main(void) { PORTB |= 1 <&...
Igor Liferenko's user avatar
5 votes
4 answers
4k views

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". ...
Jot's user avatar
  • 3,246
5 votes
2 answers
168 views

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 ...
Cerin's user avatar
  • 1,638
5 votes
1 answer
1k views

Remove Bootloader on Arduinos

I am trying to move from arduinos to AVR C. Would somebody know how to remove the arduino bootloader from the microcontroller? Is there a different process for the different atmega microcontrollers ...
Naan's user avatar
  • 73
5 votes
1 answer
115 views

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 ...
Dakkaron's user avatar
  • 229
5 votes
2 answers
464 views

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 ...
Karoly S's user avatar
  • 281
5 votes
1 answer
2k views

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's user avatar
  • 3,469
4 votes
3 answers
2k views

Do I need a bubble sort or something easier?

I'm using an Arduino Leonardo and a GPSTiny++ library to parse NMEA strings from my GPS receiver. In this chunk of code I'm averaging all satellite SNR numbers for satellites which are locked (Being ...
Dan's user avatar
  • 43
4 votes
1 answer
2k views

How do I prevent Arduino from running on startup?

I just uploaded a sketch to my Arduino Leonardo, which presses a key on the keyboard. The code was unfortunately bugged and now as soon as the Arduino is powered on, the key is being pressed. When I ...
user avatar
4 votes
3 answers
4k views

Getting a fixed sampling rate

Ultimately I will move to a generic smart phone for this project. I'm trying to read 4 analog inputs from my arduino with a fixed 1kHz sampling frequency. I managed to set it to read at 1kHz as you ...
Isra's user avatar
  • 95
4 votes
1 answer
2k views

Arduino Leonardo(Atmega32u4) - Detecting if USB is connected to a computer?

The closest thing I can find is if(Serial) but that only returns true if there's a serial port open. The function I want, ideally, should: Return true if plugged into a computer Return false if ...
Stephen's user avatar
  • 43
4 votes
1 answer
14k views

How to convert Arduino example sketch to a complete c++ project?

I'm experimenting something new with my Arduino Leonardo. I removed its original bootloader and flashed it with LUFA mass storage example with added functionalities(now its a firmware). I'm trying to ...
Isuru's user avatar
  • 151
4 votes
1 answer
8k views

Can Arduino Leonardo use USB port and RX TX serial pins at the same time?

Can I use the TX/RX on pins 0, 1 (to a serial slave device) while also having the USB port dedicated PC communication?
101's user avatar
  • 215
4 votes
2 answers
5k views

Uploading Sketches from Windows Command Line

The resources I've found regarding the Command Line interface seem to be out of date so I was hoping to find someone with experience using it. I'm currently running Arduino 1.5.6-r2 BETA on Windows 8....
Karoly S's user avatar
  • 281
4 votes
1 answer
1k views

It is possible to revive my Arduino Leonardo (mini beetle) board?

I have this board: It has the atmega32u4 chip. I have updated its code several times, and used it without issues for several months. Today, while updating (using Arduino IDE) it started to throw ...
lepe's user avatar
  • 141
4 votes
3 answers
835 views

Moving wiring.c functions from timer0 to timer1

I am using an Arduino Leonardo (ATmega32U4) and need to use timer0 for PWM. Since by default in the wiring.c file the functions micros() and millis() use timer0, I decided that, since timer1 isn't ...
aflyingcougar's user avatar
4 votes
1 answer
1k views

Leonardo-based tachometer?

I'm new here. I'm not a native speaker, so pardon my English. I just received my Arduino Leonardo today. I tried some basic calculations and stuff like blinking and LCD interfacing. Its interesting. ...
x0x's user avatar
  • 149
4 votes
1 answer
2k views

Wrong microcontroller found on Arduino Leonardo

When I try to upload a sketch on this brand new Arduino Leonardo, I get this error: Arduino: 1.6.11 (Linux), Board: "Arduino Leonardo" Sketch uses 4,134 bytes (14%) of program storage space. Maximum ...
Riccardo Cagnasso's user avatar
3 votes
3 answers
10k views

Leonardo: disable TX- and RX-LED

I have the (more or less) Leonardo-compatible board Olimexino-32u4. Both, the TX- and RX-LED are permanently on. To reduce power-consumption, I want to disable them by software. What is the reliable ...
Thomas S.'s user avatar
  • 566
3 votes
5 answers
15k views

Send Keyboard Media Keys with Keyboard Library

I have an Arduino Pro Micro (ATMega32u4) that I want to use as an IR receiver for a media PC and need to send codes like Volume Up, Media Home, Play, etc. But when I look up the scan codes for those ...
Adam Haile's user avatar
3 votes
2 answers
2k views

portd not writing on digital ports 5 and 7

I try to build a function generator (preferably a sine) with an R-2R ladder and a Arduino Leonardo by Borderless Electronics. For performance reasons one should use portd instead of digitalWrite. ...
stebu92's user avatar
  • 133
3 votes
2 answers
479 views

Multiple Time-Sensitive Tasks

I'm using an Arduino Leonardo and need to perform two time-sensitive tasks like this: // Task 1 - Gets executed once a second (1Hz) // Execution of task needs approx 70ms task1(); //Sending a ...
MarayJay's user avatar
3 votes
1 answer
1k views

Arduino Leonardo - Using ICSP pins for serial

I'd like to know if it's possible to use the ICSP header pins on the Leonardo as GPIO pins, for example for software serial, and how to address them. I've a project which needs all available I/O pins, ...
Christian Rodriguez's user avatar
3 votes
1 answer
3k views

What's Leonardo 5V pin current limit?

I'd like to know how much current can supply the 5V pin and the 3.3V pin on an Arduino Leonardo board. I've been lead not to trust the specs on Arduino's website. And, as an added question, can the 5V ...
Christian Rodriguez's user avatar
3 votes
2 answers
11k views

Which kind of diodes I should use in buttons/keys matrix input? (Making gaming keyboard)

When making matrix input of NxM columns/rows with push buttons, there should be a diode next to each button to prevent "ghosting" and able read many keys pressed together correctly. There is a lot of ...
gilhad's user avatar
  • 1,420
3 votes
2 answers
122 views

Stacking 3 of the same shields on top of each other and instructing them in sync

Context: I have an audio track separated into individual channels grouped by frequency and speaker location. I need to play all three of these channels simultaneously and perform instructions like ...
Edward's user avatar
  • 37
3 votes
1 answer
1k views

Can the Leonardo Arduino be used as a USB HOST for CDC Com devices?

I am trying to connect a CDC communication device to the Leonardo USB port and have communication with it via the TTL com port. Basically I want to echo to the TTL port whatever is transmitted over ...
AA9GG's user avatar
  • 31
3 votes
1 answer
214 views

Interfacing Arduino Leonardo with PCA8574AN

I'm trying to interface my Leonardo with a "Mindsensors Magic Wand" - 8 LEDs connected to a PCA8574AN chip. On the manufacturer's page, they say it's compatible with Arduino, however no instructions ...
Tim's user avatar
  • 45
3 votes
3 answers
1k views

How Do I Properly Ground my Arduino Leonardo using Capacitive Sensor?

Hi we are using Arduino Leonardo with some electric paint and Capacitive Sensor Libraries. We have a lot of variance in our Serial output from our sensors, we believe if we grounded the Arduino we ...
user1354's user avatar
3 votes
2 answers
427 views

How do I recover a beetle where I loaded a program that was too large and overwrote the bootloader?

I'm doing on-target unit testing for an industrialized application and my test code is too large to fit everything on the board at the same time. I'm using the Sloeber toolset to develop, and I put ...
Laurence Gordon's user avatar
3 votes
1 answer
371 views

Arduino Leonardo runs unusually hot

I have a genuine (purchased from Adafruit) Arduino Leonardo that I have had for 2 years and I have not had any issues with. However, I have always noticed that it seems to be running suspiciously hot ...
3871968's user avatar
  • 308
3 votes
0 answers
110 views

Why would using the += operator on an unsigned long crash my sketch? [closed]

I wrote a simple Timer class that's designed to work even in the face of the 49 day wrap of the millis() counter. I wanted a library that I could easily re-use and I could never remember the right way ...
Tim Long's user avatar
  • 305
3 votes
0 answers
1k views

TRIAC Pulse driver for Spot Welder (help needed with programming)

I have designed and built a transformer driver board for my spot welder. It is powered from mains electricity (230 V) and consists of the following segments: triac drive and protection, zero cross ...
Pioter's user avatar
  • 31
3 votes
1 answer
164 views

Specific values not showing when using a numeric keypad

I have attached a 3x4 keypad to my Arduino Leonardo as an input method. Whenever I press the buttons, the majority of the keys work but specific ones don't. Here's my code, I've set it up to beep a ...
Neonalig's user avatar
3 votes
0 answers
328 views

Arduino IDE programs Leonardo but cannot open serial terminal

I'm using Arduino: 1.6.7 (Mac OS X 10.11.3), Board: "Arduino Leonardo". When I try to program my code, it works without problems. When I want to open the built-in Serial Monitor or Serial Plotter, ...
Thomas's user avatar
  • 143
3 votes
0 answers
2k views

Using USB on a Leonardo to receive data from PC

I am new to the Leonardo, having only used a duemilanove before, and I am interested in using it's USB capabilities for a project. Basically I need it to be an input and output device, communicating ...
BytesGuy's user avatar
  • 131
3 votes
1 answer
4k views

TCCR1A and TCCR2A on Leonardo

I'm trying to use the TTS library for Arduino on an Arduino Micro board, which is based on the Leonardo. When I try to compile my sketch I get some errors; /libraries/TTS/TTS.cpp: In function 'void ...
NoChecksum's user avatar
3 votes
0 answers
189 views

9v adapter burned out Leonardo style board

My first experience with Arduino ended in a tragedy. I bought a Leonardo from ebay and upon arrival, attached it to my laptop. Programmed a simple blink demo with the onboard LED. It started working. ...
Helium's user avatar
  • 131
3 votes
0 answers
4k views

Using Leonardo and getting absolute x,y Mouse values

Trying to modify the native mouse methods so that it can use absolute, rather than the relative values it currently uses. This is so it can function as a touch screen pointer, and NOT a mouse. Am ...
Bachalo's user avatar
  • 251
2 votes
2 answers
1k views

Pinout for Leonardo USB

According to the docs, the Arduino Leonardo uses digital pins 0 and 1 for the USB D- and D+ lines. However, which is which? e.g. is D0=D+ or is D1=D+? To save space in a very tight project, I want to ...
Cerin's user avatar
  • 1,638
2 votes
2 answers
14k views

Disabling i2c internal pull up resistors

How do you do this? I've been digging around and I can see that I should do this and supply my own external pull up resistors but I don't know exactly how to disable them. The pages I've been reading ...
David Tran's user avatar

1
2 3 4 5
7