Most Popular

1500 questions
8
votes
3 answers

Why is 'n' parameter of snprintf ignored?

I have found that the n parameter of snprintf() seems to be ignored in my code. char asdf[10]; Serial1.println(snprintf(asdf, 2, "hello")); This prints 5 when I would expect it to print 2. What is happening?
Westin
  • 83
  • 4
8
votes
2 answers

How to choose alternate I2C pins on ESP32?

I'm a begginer with Arduino and this may be a basic question but I'm facing an issue. I'm using a HTU21D sensor with an ESP32. This sensor use I2C communication. Inside the Arduino library, there is this function to start to collect data: //Start…
Gazouu
  • 273
  • 2
  • 4
  • 10
8
votes
3 answers

Arduino IDE Permision Denied For Upload, Ubuntu

I am having issues uploading to my Arduino from the IDE on Ubuntu 18.04. The error message I have received is: Arduino: 1.6.10 (Linux), Board: "Arduino/Genuino Uno" avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied I have…
Neal
  • 81
  • 1
  • 1
  • 3
8
votes
2 answers

How do I (easily) power a 5 V 3-pin fan?

I have a 5 V 3-pin fan. I want to be able to: power it from an Arduino Uno or a Seeeduino Lotus board, and, ideally; be able to change its speed. Most resources I can find on the web explain how to connect a standard 12 V fan and moreover…
Arseni Mourzenko
  • 235
  • 1
  • 3
  • 9
8
votes
3 answers

How to stop Arduino from drawing power through USB

I'm working on an embedded project, where I use arduinos as a "sensor shield" for RaspberryPi (I have model B). The problem is, that the RaspberryPi's USB port is not powerfull enough to drive WiFi adapter and arduino with sensors. The solution is…
jnovacho
  • 235
  • 1
  • 3
  • 7
8
votes
3 answers

Creating formatted String (including floats) in Arduino-compatible C++

I'm using a Mega2560 and a generic SSD1306 OLED display with the Adafruit_SSD1306 (and by extension, Adafruit_gfx) library. I need to print a bunch of float values (ranging between 30.0 and 99.9) to the display with exactly one decimal place of…
Bitbang3r
  • 523
  • 1
  • 3
  • 11
8
votes
1 answer

Is it better to use c_str or toCharArray?

When reading/trying a recent answer, I was surprised to see that Arduino's String class supports the c_str() method, just like the C++ std::string class. As expected, it appears to get a pointer to the string's contents as a null-terminated char…
Peter Bloomfield
  • 10,932
  • 9
  • 47
  • 87
8
votes
4 answers

ATtiny85. How do I burn a bootloader? What is the process?

I want to use all six I/O pins of an ATtiny85, that means also using the reset pin as an I/O pin, however, I found out that if I disable the RESET pin, I can no longer program the ATtiny using an ISP programmer. However, I found out that there are…
Calin
  • 243
  • 1
  • 3
  • 9
8
votes
3 answers

Make an Arduino board act as both a usb storage device and a keyboard?

I am making an interface project that, when plugged into a computer, shows up as both usb flash storage and can type like a keyboard when some physical buttons on the board are pressed. I have seen projects that do one or the other, but not both at…
teasub
  • 81
  • 1
  • 2
8
votes
3 answers

softwareserial between arduino uno and esp8266

I have an Arduino UNO and HUZZAH ESP8266 module. I need to send data between Arduino UNO and ESP module via Software Serial. Right now I have the ESP module write data and Arduino UNO display data, but not working. When I run the Arduino UNO and…
Marquinio
  • 183
  • 1
  • 1
  • 6
8
votes
1 answer

How to generate hardware interrupt in mpu6050 to wakeup arduino from SLEEP_MODE_PWR_DOWN mode?

I am using Arduino UNO and has kept in SLEEP_MODE_PWR_DOWN mode & want it to wakeup using MPU6050 hardware INT pin (which should send a signal when MPU is in motion). I have used the article…
bandejiya
  • 307
  • 1
  • 4
  • 12
8
votes
6 answers

Over-the-air upgrades?

I'd like to be able to upgrade software on an arduino without physically touching the device or stringing a cable. Can it be done? Will pick wireless protocol that makes that easiest.
Johannes Ernst
  • 181
  • 1
  • 4
8
votes
2 answers

Performance of internal vs external resistors

Is there any significant performance trade-off between buttons wired with the internal vs external pull-up/down resistors? I see a lot of tutorials demonstrating the use of external resistors when wiring a simple button, like this and this. But…
Cerin
  • 1,618
  • 2
  • 24
  • 41
8
votes
2 answers

Arduino IDE fails on Fedora with arduino-builder error "Parameter 'tools' is mandatory"

The arduino-builder app when invoked directly with parameter --tools /usr/bin works, but the IDE fails with the error in the title for any sketch (including the Blink example). I've tried adding things to preferences.txt…
goldilocks
  • 371
  • 3
  • 13
8
votes
3 answers

Are there any reasons to pick Nano over Micro?

Nano is from 2008, and micro from 2012. Micro seems better on every parameter, in particular in having a better (I think) microcontroller, ATMega32u4, over ATMega328P. However, all the shops I've checked out, both local and online, sell the Nano,…
Mads Skjern
  • 1,125
  • 3
  • 13
  • 23