36 votes

How to read and write EEPROM in ESP8266

While EEPROM.read and EEPROM.write are valid methods, it's like mopping the floor with a toothbrush. Use EEPROM.put and EEPROM.get instead. For example: #include <EEPROM.h> void setup() { ...
codechimp's user avatar
  • 461
25 votes

CLion + Arduino

Rather than using any plugin, I am using CLion with PlatformIO, which supports several IDEs. CLion then not only gives you code completion, but also full support for refactoring, Git, and much much ...
Arjan's user avatar
  • 491
21 votes
Accepted

Split up Arduino code into multiple files using Arduino IDE

There is no need to use an #include directive for the additional .ino file. Before compilation starts, the Arduino IDE concatenates all .ino files in your sketch into a single file, starting with the ....
per1234's user avatar
  • 4,048
18 votes
Accepted

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

I don't understand why this worked, but I found this comment in Redhat Bugzilla (it doesn't seem to be a bug report specifically about that...but anyway): Parameter 'tools' is mandatory [.....
goldilocks's user avatar
17 votes
Accepted

Only 2 decimal places in printed float

By default, the Serial print function shows only 2 decimals, however I'm sure the float has the full (unrounded) value, even if it does not show it. You can read about it in the official ...
Michel Keijzers's user avatar
15 votes

ESP8266, Arduino IDE vs Lua?

Lua, like many scripting languages, tends to make you a lot more productive as a programmer: things become far easier as you work at a higher abstraction level and do not worry about trivial things ...
Edgar Bonet's user avatar
  • 42.2k
14 votes
Accepted

Which C++ standard does the Arduino language support?

The Arduino "language" is nothing more than a set of C++ functions and classes. It does not mandate any particular C++ standard. The standard is dictated purely by the compiler that the core ...
Majenko's user avatar
  • 105k
13 votes
Accepted

ESP8266, Arduino IDE vs Lua?

Using the Arduino IDE is custom firmware. That's what you're writing. You don't need any new firmware because the new firmware is what you are writing. I can't think of any downsides to using C++ to ...
Majenko's user avatar
  • 105k
13 votes

Arduino and fingerprint scanner - can I get the fingerprint scanner data?

I'm a software engineer that works with biometric sensors. The answer is, it will vary greatly depending on the scanner you've chosen. Some hardware solutions have built-in subject enrollment and ...
automaton's user avatar
  • 231
12 votes

Different ways (and the fastest) to compute sines (and cosines) in Arduino

The two basic methods are mathematical calculation (with polynomials) and lookup tables. The Arduino's math library (libm, part of avr-libc) uses the former. It is optimised for the AVR in that it ...
Majenko's user avatar
  • 105k
12 votes
Accepted

Linux can not open arduino IDE - java.lang.NullPointerException

I had to install arduino-avr-core package: sudo pacman -S arduino-avr-core Now it works fine
Jan Černý's user avatar
11 votes
Accepted

What is the relationship of an Arduino .ino file to main.cpp?

The Arduino uses the gcc compiler. That compiler wants a normal main function of course. Arduino has put a layer on top of that with setup and loop. The hidden main function for basic Arduino boards ...
Jot's user avatar
  • 3,216
11 votes
Accepted

Confuse about PROGMEM and R"====()===="

why you should put your variables in flash memory instead of SRAM Because the Arduino has only a very small amount of memory. If you have data that will never change it's better to store it in flash (...
Majenko's user avatar
  • 105k
10 votes
Accepted

Difference between /dev/ttyACM0 and /dev/ttyS0 (Arduino IDE ports under Linux)

/dev/ttyACM0 is a USB communication device (CDC) of sub-type "abstract control model" (ACM). That is what the Arduino is. /dev/ttyS0 is a hardware serial port - the (typically) 9-pin D connector on ...
Majenko's user avatar
  • 105k
10 votes

CLion + Arduino

I know this was asked a long time ago, but maybe it will be useful for someone. I'm a beginner, regarding all this stuff, so if anybody knows a better way to do it, please correct me. here is how I ...
Wanek T's user avatar
  • 101
10 votes

How to determine Flash size?

Arduino's ESP8266 support includes an example sketch called CheckFlashConfig. This probes the board, and prints the flash memory size.
scruss's user avatar
  • 251
10 votes
Accepted

Programming Chinese Arduinos

It's because these are unprogrammed chips, meaning they haven't had a bootloader programmed into them yet. Here is a tutorial for using your Arduino board to program a bootloader into them (there are ...
JRobert's user avatar
  • 15.1k
10 votes

Adding a custom board to the Arduino IDE

The simplest clean way to add your board using an existing core is to add the variant to your sketches folder's hardware subfolder. Only boards.txt and files for the board variant are added. In your ...
Juraj's user avatar
  • 17.8k
10 votes
Accepted

avrdude ser_open() can't set com-state

Maybe a Windows driver problem. Do your uno and nano use a ch340? (It is the component translating USB to uart (serial pins of atmega328). Windows has no software way to differenciate boards using ...
Bouc's user avatar
  • 192
9 votes

Program an ATMega328P and use it without Arduino board

Yes you can use ATMega328P without arduino board. I always use the IC without arduino. There are two ways of doing it. You can use arduino board with the IC. Program the IC and then take it out and ...
Aircraft's user avatar
  • 293
9 votes
Accepted

Can I use arduino's 3.3 V output directly to esp8266?

You should search for this data yourself, but since you are saying you are a newbie I'll tell you how to find this. First of all you should search for a document called "datasheet". On a datasheet ...
frarugi87's user avatar
  • 2,721
9 votes
Accepted

How to setup OpenCV with Arduino?

If you are thinking of using OpenCV with a "normal" Arduino, such as the Uno or Mega, then think again. OpenCV runs on a computer - be that a desktop computer or an embedded computer. Basically you ...
Majenko's user avatar
  • 105k
9 votes

Only 2 decimal places in printed float

By default, Serial.print() prints floats with two decimal digits. float num = 7.875; Serial.println(num, 4); will print num with 4 decimal digits, thus: 7.8750. The precision of float is not ...
Fauzan's user avatar
  • 375
9 votes

How to get the firmware (hex) file from a .ino file containing the code

You are asking how to locate the compiled hex file. It's easy! Follow these steps: In the Arduino IDE select Sketch > Export Compiled Binary. This performs a compile. Once complete, this command ...
sa_leinad's user avatar
  • 3,188
9 votes

Arduino IDE and subfolders

From Arduino IDE 1.6.10 onward the Arduino IDE compiles all source files in the src subfolder of the sketch and recursively through all folders under the src folder. Support for compilation of sketch ...
per1234's user avatar
  • 4,048
9 votes

Arduino and fingerprint scanner - can I get the fingerprint scanner data?

There is a discussion thread on Quora discussing finger print scanners that provide raw output. The Quora author recommends a Futronic device which comes with an API for raw image collection. They ...
RowanP's user avatar
  • 851
8 votes
Accepted

ESP8266 Analog read interferes with wifi?

I have found that this was caused by reading the analog pin to many times in a short period of time. I replaced ldrState = map(analogRead(ldrPin), ldrMin, ldrMax, 0, 100); Serial.println(...
JanG's user avatar
  • 183
8 votes
Accepted

Can I use Visual Studio instead of Arduino IDE?

I only use Visual Studio for Arduino programming. Arduino Plugin for Visual Studio
beater's user avatar
  • 204
8 votes
Accepted

Why can't the Atmel ATtiny family delay over a minute?

This is absolutely nothing to do with "why can't the atmel attiny family delay over a minute?". It is all to do with the way that C++ works. See my page about Integer arithmetic and overflow. To ...
Nick Gammon's user avatar
  • 37.9k

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