Hot answers tagged

36 votes
Accepted

Warning when verifying sketch with VS code

Thanks to @Majenko I looked some place new: documented in the arduino plugin of VS Code Arduino Extension there is an option to set an output directory. Note though that according to this it should ...
user avatar
28 votes

Warning when verifying sketch with VS code

To clarify the answer, for those new in arduino world +StudioCode (source: https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-arduino ) The following settings are as per sketch ...
user avatar
19 votes

How to I make the Tx and Rx pins on an ESP-8266-01 into GPIO pins?

Add this to your code at the beginning of set void setup(): //********** CHANGE PIN FUNCTION TO GPIO ********** //GPIO 1 (TX) swap the pin to a GPIO. pinMode(1, FUNCTION_3); //GPIO 3 (RX) swap the ...
user avatar
15 votes
Accepted

List of Arduino board preprocessor #defines

The list of board symbols can be generated by this shell command: $ grep board= boards.txt | cut -f2 -d= | sort -u AVR_ADK AVR_BT AVR_DUEMILANOVE AVR_ESPLORA AVR_ETHERNET AVR_FIO AVR_GEMMA ...
user avatar
  • 7,851
13 votes
Accepted

Is it possible to upload previously compiled binary?

Yes! Its possible that you can upload a previously complied binary, using AVRDUDE - a command line utility which is actually used to upload binaries, behind the arduino IDE. You can find AVRDUDE in ...
user avatar
  • 371
12 votes

Can I use notepad++ for writing sketches?

You can easily use notepad++ or any text editor to edit arduino code files (.pde or .ino). I use the sublime text editor for all my arduino coding. As you noted, the arduino syntax is c++, so setting ...
user avatar
  • 4,309
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
user avatar
  • 204
6 votes
Accepted

Arduino screws up trivial program involving enum

You can workaround the issue by putting your enum and function into a namespace. You can even take advantage of C++ unnamed namespaces if you like: namespace { enum WhatArduinoIs { Easy, But, ...
user avatar
6 votes

Access denied when Uploading

There might be another device has already connected to that port. It could even be a terminal emulator which is left connected from last debugging session. Otherwise, make sure that your UNO is ...
user avatar
  • 394
6 votes

List of Arduino board preprocessor #defines

Mikael has the right answer, but there are multiple boards.txt files depending on the installed boards with board manager, modifying the command to: grep board= `find . -name boards.txt` | cut -f2 -d=...
user avatar
  • 61
6 votes
Accepted

Collection of functions for arduino IDE

You need to "split" your library. Placing full functions inside a header file (.h) is bad form and causes the exact problem you are seeing. Every time you include the header file you create an ...
user avatar
  • 103k
5 votes
Accepted

Where is documentation on Arduino's Internal Interrupts?

The vector names are all defined within the header files for the main chip in the compiler. The IDE doesn't need to know anything about that kind of thing - that's all up to the compiler. Look for ...
user avatar
  • 103k
5 votes

Why does the standard Arduino IDE not include the CH341G USB Drivers?

This is simply because the CH340G is not supported officially. The Arduino IDE is meant primarily for genuine Arduinos. What you could do is repackage the Arduino zip file with the required library ...
user avatar
5 votes

Why does the standard Arduino IDE not include the CH341G USB Drivers?

I should mention that the CH340G are also used in many "Arduino Nano" clones from China. I believe that the Arduino company already has concerns about the number of unofficial clones (many pretending ...
user avatar
  • 35.3k
5 votes

Is it possible to reduce the size of this program to 1KB

There are several problems with your program as shown that make a good answer impossible. After I list those problems, I'll then proceed to give an answer, partly good, partly bad. The good part is ...
user avatar
5 votes

How to I make the Tx and Rx pins on an ESP-8266-01 into GPIO pins?

Tx = GPIO 1 Rx = GPIO 3 Should work but be careful cause if they burn, you won't be able to program or even talk to the ESP anymore.
user avatar
  • 2,803
5 votes
Accepted

Porting code from Arduino IDE to other IDEs - expected code size reduction

You don't need to abandon the Arduino IDE. Let me quote from my forum post about sketch sizes. Introduction Every now and again this subject pops up on the Arduino forum. Why does it take 1000 ...
user avatar
  • 35.3k
4 votes

Arduino screws up trivial program involving enum

You seem to be correct about what the arduino IDE is doing to your sketch. Arduino will not preprocess any .h or .cpp files, so you could use a second file. you could also break the IDE's function ...
user avatar
  • 4,309
4 votes

Trying to track down macro or #define values, possibly in arduino preprocessor

It might help to point out the use of -D switches of gcc here. If you turn on verbose output of the Arduino IDE (I am using a pretty old version): you will see, when you compile a sketch, that the ...
user avatar
4 votes

What are the other IDEs for Arduino?

PlatformIO I use GitHub's Atom text editor with the PlatformIO package. I like both of them: Atom has various useful built-in features and over 6,000 packages (which can be easily downloaded and ...
user avatar
4 votes

Can I use notepad++ for writing sketches?

You can use any editor to write Arduino code. @BrettM has already detailed it. Instead of the external editor option, you can do away with the Arduino IDE completely using Makefile and build and ...
user avatar
  • 358
4 votes

How to avoid report of unsuitable sketch names?

That message is actually a hang-over from when the IDE was Processing. The name of a file had to match the name of the Java class within that file, and there are strict rules about what can be in a ...
user avatar
  • 103k
4 votes

How to use C Libraries for Arduino code

Some of the libraries you mention (iomanip, iostream, queue, string) are part of the STL - Standard Template Library. Whilst it does not ship with the IDE download, you can install it yourself. See ...
user avatar
  • 35.3k
4 votes
Accepted

How to simply close a tab?

You cannot close a tab in the Arduino IDE. If a file exists in the sketch then it is there with a tab. Deleting a tab deletes the file. In the Arduino IDE a tab is a file and a file is a tab. You ...
user avatar
  • 103k
4 votes

Cannot upload sketch to Arduino Nano

When using a cheap knockoff Nano, it seems that in the newer versions of the Arduino IDE (at least in 1.8.8), you may need to select "ATmega328P (Old bootloader)" from the Processor options under the ...
user avatar
  • 274
4 votes
Accepted

Writing your own Arduino flashing tool

This application already exists. It's called AVRDUDE: http://www.nongnu.org/avrdude/ You can download it compiled for Windows at the link above. This is the very flashing tool that the Arduino IDE ...
user avatar
  • 3,844
4 votes

Certain String Characters To Int

How about char array[5] = "T 20"; int num = atoi(array+2); This obviously assumes that all your strings are of the same format "A NN". If not, you can try parsing it using strtok(). See this ...
user avatar
  • 375
4 votes
Accepted

Is there alternative to arduino IDE program ESP8266 and ESP32 with arduino toolchain?

Not an exhaustive list. Most advantages will be subjective. UECIDE - Wide variety of boards, not only Arduino, better editor and serial monitor, plug-in based modules. PlatformIO (Available as plugin ...
user avatar
  • 6,932
4 votes

Are there any alternatives to Tinkercad Circuits that is PC application based instead of web app based?

I work with the wokwi Arduino simulator It is faster It uses the latest Arduino IDE for compilation It almost runs in real-time. For example, your job of 15 seconds might get executed at about the ...
user avatar
4 votes

Random "Compilation error: Error: 13 INTERNAL: exit status 1". No clue how to resolve or even what causes this error

The problem with that error message is that you are only reading the very last line. That line says "Oops, it didn't compile". The actual error message occurs before that. You need to read ...
user avatar
  • 103k

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