Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [arduino-leonardo]

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

34
votes
1answer
133k 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: ...
17
votes
2answers
21k 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 ...
9
votes
4answers
7k 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 ...
8
votes
4answers
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 ...
6
votes
3answers
422 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 ...
6
votes
1answer
718 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 ...
5
votes
4answers
1k 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". ...
5
votes
3answers
1k 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 ...
5
votes
2answers
133 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 ...
5
votes
2answers
382 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 ...
5
votes
1answer
1k 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.
4
votes
2answers
4k 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....
4
votes
1answer
665 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 ...
4
votes
1answer
375 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 ...
4
votes
1answer
143 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 ...
4
votes
1answer
90 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 ...
4
votes
1answer
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. ...
3
votes
3answers
992 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 ...
3
votes
4answers
134 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 <&...
3
votes
1answer
637 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, ...
3
votes
3answers
5k 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 ...
3
votes
1answer
5k views

Simple Multiple RX/TX SoftwareSerial?

In this project I will be using multiple ESP8266 WiFi modules (4) connected by software serial to an Arduino Leonardo Micro (1 UART). I plan to rotate between all 4 (starting with 2): Open port, write,...
3
votes
3answers
4k 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 ...
3
votes
2answers
82 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 ...
3
votes
1answer
178 views

Two Leonardos on one USB hub - not working properly

I have two Arduino Leonardos here. They do different things, but basically they both emulate a keyboard. Here is an example: const byte SWITCH = 12; void setup () { Keyboard.begin(); pinMode (...
3
votes
1answer
542 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 ...
3
votes
1answer
3k 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 ...
2
votes
2answers
533 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 ...
2
votes
3answers
6k 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 ...
2
votes
1answer
157 views

How can I detect which baudrate a virtual COM port is set to?

I would like my software running on Leonardo to behave differently depending on the baudrate of the USB Serial set by the PC. For example, I want to make a smart USB to UART converter which performs ...
2
votes
2answers
1k 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. ...
2
votes
2answers
906 views

Powering ESP8266 from Leonardo's 3.3v pin

I'm new to Arduino, and I'm trying to connect my Leonardo via WiFi using a ESP8266 module. What I want to know is if I can power it directly from the onboard 3.3V pin like in the image: Or do I need ...
2
votes
2answers
4k 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 ...
2
votes
1answer
4k views

USB MIDI HID with the ATmega32u4?

There are existing projects that allow the Uno and other devices using the ATmega8u2 to operate as a USB MIDI HID, such as MocoLUFA. Unfortunately, as far as I am aware, these require uploading new ...
2
votes
1answer
975 views

Keyboard.print() skips keys

I'm playing with the Arduino Leonardo Keyboard.print() command, but I'm facing a annoying problem: When I print a double quote, it will not appear and also will make to disappear the next character (...
2
votes
1answer
897 views

Does Leonardo need a separate power supply?

I'm currently using an Arduino Uno (R3), but want to switch to Leonardo for the USB-ability. The Uno can work from the USB's 5V. Looking at the Leonardo's schematic it seems the only input to the ...
2
votes
3answers
6k views

Explanation please, of hardware and software serial links

I am starting to use a Seeeduino GPRS shield (please see note), which is essentially an Arduino Leonardo that, among other things, can be used as a mobile 'phone for sending and receiving texts. I ...
2
votes
1answer
235 views

Arduino Uno and Leonardo SPI clock can't be measured

I want to measure the SPI clock (pin 13) using the Arduino example code for the SPI library (very simple example). Basically independent from the loop function, the clock should be fired continuously. ...
2
votes
1answer
529 views

Arduino Leonardo RX TX mystery

I'm at the tail end of a project using a Leonardo, a HC-06 bluetooth module and a few cell phone vibration motors. Everything is working fine except the serial communication between the Leonardo and ...
2
votes
6answers
6k views

Better cycling through the RGB colors

I have been trying to achieve a way to tap into the 16 million colors RGB provides for this LED strip. I thought of using LEDS.setBrightness(); but I have not been successful in my attempts. I have ...
2
votes
1answer
694 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 ...
2
votes
1answer
1k views

RF24 tranceivers: trouble with two way communication

I am using RF24 modules with my two Arduinos Leonardo with the RF24 library. My goal is to be able to press a button on the first Arduino which will light up an LED on the second Arduino, and be able ...
2
votes
4answers
917 views

Conflicts with USB and external power supply

I want to power an Arduino Leonardo with an external power supply and simultanously communicate via USB. I have read some other threads on this topic, therefore, I know that if one supplies more than ...
2
votes
1answer
831 views

I2C seems to stop working when I attach an AF motor shield

I have a cheap MPU 6050 chip that communicates over 3.3V I2C. I can talk to it just fine on my Leonardo. If I add an additional Adafruit Motor shield (the old one), my MPU 6050 demo sketch hangs ...
2
votes
1answer
157 views

Pro Micro recognised as Micro (win10, IDE 1.8.1)

I just got this pro-micro clone 5V and it's my first pro micro ever. After reading lots of discussions about how easy it is to brick and how it's just a smaller Leonardo, I've also found tutorials ...
2
votes
1answer
545 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 ...
2
votes
1answer
9k views

Sending data via bluetooth

I am trying to both send and receive data using bluetooth module. Receiving data works fine with this code: void setup() { Serial1.begin(9600); Serial.begin(9600); } void loop() { if ...
2
votes
1answer
340 views

ATmega32U4 (Leonardo/Pro Micro) bootloader, 8K rather than 4K?

Recently hit the dreaded 0x7000 / 28k~ AVRDUDE+LUFA limit. It states everywhere this is because the bootloader uses 4KB, thus reducing the 32KB to 28KB. Makes sense, except... Blank sketches on the ...
2
votes
1answer
200 views

How to calculate voltage?

I want to check each cell voltage using arduino. and how to calculate dc current using CT Sensor using Arduino?
2
votes
2answers
7k 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 ...