Skip to main content
38 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
  • 481
22 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,178
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
  • 43.3k
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

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
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

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
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,246
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
11 votes

Problem with a function having a parameter with a default value

It's just a failing of the Arduino build process to generate prototypes (function declarations) for functions that have default argument values. There's otherwise nothing wrong with what you're doing....
timemage's user avatar
  • 5,324
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.3k
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
  • 18.1k
10 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,178
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
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 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
  • 869
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
  • 38.4k
8 votes
Accepted

Most memory efficient way to program

That is an incredibly hard question to give a definitive answer to. In general using OO consumes more memory, but that is the price you pay for greater flexibility and ease of use. The difference is ...
Majenko's user avatar
  • 105k
8 votes
Accepted

In ESP-12E NodeMCU, what's the pin number of A0?

The numeric value of A0 is 17, as defined here. But unlike on an Arduino board, you can't use it as a digital pin. It only work for pin numbers 0-16. If you are using as a parameter for analogRead, ...
gre_gor's user avatar
  • 1,682
8 votes

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

There are some good answers here but I wanted to add a method which hasn't been mentioned yet, one very well suited to computing trigonometric functions on embedded systems, and that's the CORDIC ...
Halzephron's user avatar
8 votes
Accepted

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

In the Preferences of the Arduino IDE; after Show verbose output during: check the box next to compilation. Then when you compile you should get something like this at the bottom of the window: ... ......
Gerben's user avatar
  • 11.3k

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