Skip to main content
11 votes

How can I stop digital pins from floating at reboot?

You could in principle set the pin state a little bit earlier, by plugging your code into the C runtime's initialization sequence. This, however, will only buy you a few microseconds: the pins will ...
Edgar Bonet's user avatar
  • 45.2k
6 votes
Accepted

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

did somebody come across such case, or I'm the first in the world? You are not the first. I recently got bitten by the very same issue. However, unless you are close to an unusually strong radio ...
Edgar Bonet's user avatar
  • 45.2k
6 votes
Accepted

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

From looking at the source it appears that on 32u4 based boards Serial includes extra methods to access the settings from the USB host: see: https://github.com/arduino/ArduinoCore-avr/blob/...
Craig's user avatar
  • 2,120
5 votes
Accepted

Help with AlphaNumeric array

All of those "A1" "A2" pins have other numbers that go with them. The A1 or A2 is #defined in the core to be some number. You can just use A1 or A2 and it will work. For example, try this line and ...
Delta_G's user avatar
  • 3,391
5 votes

Generated frequency is not as expected

digitalWrite() takes a few microseconds to execute as well. There is also some overhead around the delayMicroseconds() function. If you need exactly 500 kHz, you would want to consider using a timer. ...
towe's user avatar
  • 875
4 votes

How accurate is arduino time keeping?

As others note this is dependent on the oscillator used on the main microcontroller and care needs to be taken to distinguish this from any IC doing the USB communications on boards like the UNO R3. ...
KevinJWalters's user avatar
4 votes

Arduino I2C Wire.onReceive hangs after a few loops

After a bit of tinkering, I noticed that removing the delay() call in the slave fixed it and there were no more hangs. Also, when using the Servo library to move a servo instead of blinking the led, ...
Valentin Brasso's user avatar
4 votes
Accepted

Arduino Leonardo/Pro Micro sleep and USB

The Arduino has several sleep modes. They differ mainly by the clocks that are kept running, the peripherals that are enabled, and the possible wake-up sources. All these modes are described in the ...
Edgar Bonet's user avatar
  • 45.2k
3 votes
Accepted

Failed to initialise SD card on Leonardo

A Leonardo has the SPI pins on the ICSP header, not on pins 11, 12, 13. And a Pro Micro has the SPI pins on 14, 15, 16.
gre_gor's user avatar
  • 1,682
3 votes

Send Keyboard Media Keys with Keyboard Library

It is indeed possible and also without the requirement to modify the Arduino environment itself. Just register an HID descriptor for the "report ID" for "Consumer Control" (the ...
Peter Mortensen's user avatar
3 votes
Accepted

Arduino Leonardo RX TX mystery

An Arduino Leonardo has native USB support. Which means that it has separate serial interfaces to the PC and to the hardware pins. Serial is only used for the communication with the PC and is ...
gre_gor's user avatar
  • 1,682
3 votes

Multiple SPI device

Some card reaaders (as well as display boards with built-in sd socket) use 10-kOhm resistors in series to the CS, DIN and CLK lines, to perform a cheap 5V to 3.3V level translation. This is really not ...
next-hack's user avatar
  • 411
3 votes

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

A test with an Arduino Uno. I used the usb connector to power-on the arduino uno. The led is at PB5, so I have exchanged PB0 and PB5. My test is therefor not the same. #define LED_PB PB5 // pin ...
Jot's user avatar
  • 3,276
3 votes

Multiple Time-Sensitive Tasks

Two possible solutions: Split the serial string in small pieces so it's (comfortably) less than 50 ms and send the string in 'pieces' … you could even send it until e.g. 45 ms has been reached and ...
Michel Keijzers's user avatar
3 votes
Accepted

Why can the Xbox360 not detect the Arduino Leonardo as keyboard?

Like Juraj and Majenko said. Arduino Keyboard library does emulate "Boot Keyboard". I use NicoHood HID library and now it works.
eolandro's user avatar
  • 141
3 votes

Arduino sketch uses too much memory storage space?

There is no problem here, please read the message carefully! It says you are ONLY using 30% of the available program memory and 19% of the dynamic memory. You have a LOT more room left.
jwh20's user avatar
  • 1,045
3 votes
Accepted

LiquidCrystal issue with HD44780 display

The error is, that V0 has VDD level by the way you connected the resistors. The "lower end" of your ladder needs to be at GND, pin 1. The pin 15 (A) is the anode of the backlight, and is not ...
the busybee's user avatar
  • 2,427
3 votes
Accepted

Can't type backslash (\) with Keyboard library

You have to keep in mind that the Arduino doesn't send characters to the computer. Instead, it simulates key presses, and the computer has to translate those into characters, according to some ...
Edgar Bonet's user avatar
  • 45.2k
3 votes

Can one re-program a Leonardo Eth via its Ethernet port only?

The Leonardo Eth can not be re-programmed over the Ethernet port. Arduino Leonardo ETH has the W5500 Ethernet chip wired over SPI to the ATmega32U4 MCU. The MCU is SPI master. The network stack runs ...
Juraj's user avatar
  • 18.3k
2 votes

Arduino Leonardo keyboard

The Arduino Leonardo, in the same way as any keyboard, just sends keystroke data. It is down to your computer's operating system to translate those into individual letters and symbols. The Leonardo (...
Majenko's user avatar
  • 106k
2 votes

How to "break" a function we made?

I may be missing something, but couldn't you just modify your setLocked function? void setLocked(int locked) { if (locked) { digitalWrite(redpin, HIGH); digitalWrite(greenpin, LOW); } ...
sempaiscuba's user avatar
  • 1,042
2 votes
Accepted

Programming Leonardo with TTL to USB cable

The bootloader on the Leonardo operates through the native USB port of the ATMega32U2 chip, not the UART. You cannot treat it like an Uno because it isn't an Uno. You can only program it through the ...
Majenko's user avatar
  • 106k
2 votes

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

No, the Leonardo cannot be a USB Host. You may be able to use a USB Host Shield in conjunction with the Leonardo, though I have never tried it and cannot vouch for compatibility with the Leonardo. ...
Majenko's user avatar
  • 106k
2 votes
Accepted

Arduino IDE lost board connection

The problem: after connecting Arduino to PC via USB in 5-7 seconds IDE says that connection is losted. Yes, that's normal. That's the bootloader running, and it's during that 5-7 second window that ...
Majenko's user avatar
  • 106k
2 votes
Accepted

Storing byte array from serial and converting to a floating point number

Two things I see wrong: Serial1.write('O'); //Send command 'A' to device *noting Serial1 not Serial No, you send O not A... ??? for(int n = 0; Serial1....
Majenko's user avatar
  • 106k
2 votes
Accepted

Reading Arduino Serial Input

From the manual: http://dmx.ohaus.com/WorkArea/showcontent.aspx?id=4294974226 The balance will return “ES” for invalid commands. Check to make sure you're using the correct serial parameters that ...
jdwolf's user avatar
  • 366
2 votes

Send Keyboard Media Keys with Keyboard Library

If you are getting zeros, the most probably cause is it's the library for the IR. Reinstall or update the library. Sometimes you have to reinstall more than one time. That should work. About media ...
Jesus Ulloa's user avatar
2 votes

Can't read JSON data from client (webpage) with Arduino Leonardo ETH

Below, you create a static string, which is never used again. char json[] = "{\"index\" }"; Here you create a buffer and instantiate an empty JsonObject. StaticJsonBuffer jsonBuffer; JsonObject& ...
jose can u c's user avatar
  • 6,974

Only top scored, non community-wiki answers of a minimum length are eligible