Questions tagged [arduino-leonardo]

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

Filter by
Sorted by
Tagged with
42
votes
1answer
166k 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: ...
2
votes
2answers
8k 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 ...
2
votes
3answers
1k views

Power small hobby motor using Vin pin on Arduino and 9V battery, safe?

I want to power a small motor with a 9V battery and control it with PWM using an Arduino Leonardo. I know I can power the motor separately, but this introduces the problem of needing a battery to ...
7
votes
3answers
668 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 ...
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 ...
7
votes
3answers
5k 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 ...
5
votes
4answers
2k 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". ...
2
votes
1answer
5k 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 ...
2
votes
1answer
8k 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,...
20
votes
2answers
23k 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 ...
-1
votes
3answers
282 views

Controlling Arduino from Raspberry Pi

I am trying to control an Arduino Leonardo R3 to run some code when "triggered" from a Raspberry Pi. This would be in a loop so that it can be run multiple times. I have set up the Raspberry Pi and ...
-9
votes
1answer
4k views

STEPPER MOTOR CONTROLLER Using LEONARDO PRO MICRO

I want to Use LEONARDO PRO MICRO and A4988 Stepper Motor DRIVER to control Nema 17 Stepper Motor. Please let me know how to hookup these together. Please give me a circuit for this type of assembly ...
5
votes
2answers
5k 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 ...
4
votes
3answers
2k 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 ...
3
votes
2answers
93 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 ...
1
vote
3answers
98 views

LEDs Randomly smooth transitioning, accounting for black or how-to switch using HSV

I am stuck trying to get it not to account for black in RGB. My first instinct was to use the HSV color spectrum over the RGB rainbow but, the same code will behaves differently in HSV. If i could ...
1
vote
2answers
55 views

Leonardo - always on power, status remains between computer reboots?

I'm looking for two answer here. Is it possible to power a Leonardo to be always on, separate from the power from the USB host - I've tried with a full size Leonardo and a power adapter but for some ...
1
vote
1answer
969 views

Unable to upload code to Leonardo

I was using Arduino-Makefile to upload code to a Leonardo via its standard make upload. However, it became "stuck" and unresponsive, as Leonardo's sometimes do. I tried power cycling it, and ...
1
vote
1answer
55 views

How to get started? [closed]

I'm a guy who loves the tech world, but more in particular the Robotic one. I wanna start developing/making my first creations of robots or sort of. I won a little board from Texas Instrument from the ...
1
vote
2answers
379 views

Is there any problem about calling if (Serial) many times?

I am trying to debug a problem that I think may be related to the debug code itself and I tried to use theese macros: #define DEBUG_PRINT(x) { if (Serial) { Serial.print(x);} } #define DEBUG_PRINTLN(...
0
votes
1answer
3k views

Starting usb on pro micro after deep sleep (ATmega32u4)

I have just started playing with a low power arduino project, and have managed to get the power drain down to about 220uA using powerDown from LowPower. What I would love to be able to do is start ...
0
votes
4answers
665 views

Delay between multiple analogReads

I'm trying to read 4 analog inputs (1kHz speed). I changed the prescaler to 16 for my Arduino Leonardo according to this link. I then tried to read the analog pins and I used the following code to ...
0
votes
1answer
1k views

Recovering from lost USB connection (Leonardo to Raspberry Pi)

I have several Arduino Leonardos connected to a Raspberry Pi (running Ubuntu) via USB. They appear as /dev/ttyACM0, /dev/ttyACM1, etc. Occasionally, one will disappear and even pressing the Arduino'...
0
votes
1answer
2k views

Burning Arduino Leonardo Bootloader to ATmega32U4 with 8MHz internal clock

Burning question: So, I'm trying to burn the Arduino Leo bootloader onto a ATmega32U4 that's on 3.3V and the internal 8MHz clock. Do I have to modify and rebuild the bootloader to set the fuses ...
-1
votes
1answer
732 views

Serial communication not working between two Arduinos unless connected to computer

I have a robot with an Arduino Mega that gets data from a bluetooth module and sends it to an Arduino Leonardo to activate some functions. It all works amazing but only if the boards are connected to ...
-1
votes
2answers
75 views

Keyboardmessage on Arduino UNO

Can an Arduino UNO and Arduino Leonardo do the same things? Some of the examples in the Arduino software say to use Leonardo e.g. KeyboardMessage.