Questions tagged [compiler]
A compiler converts source code (C++, Java, etc) to machine code which is what the CPU runs.
38 questions
2
votes
0
answers
38
views
Unnecessary recompille after connection error
I sometimes multitask during a large compile (wifi, etc libraries) and don't get back in time to press the ESP32 upload button. If the connection times out, the IDE recompiles all the source again. ...
2
votes
1
answer
256
views
How to make the compiler ensure that local variables memory allocation won't cause any RAM overflow during execution?
Upon compiling a sketch using the Arduino IDE, a message like the following gets displayed in the console:
Global variables use 1540 bytes (75%) of dynamic memory, leaving 508 bytes for local ...
0
votes
1
answer
134
views
Global array doesn't get assigned the space it would take up in memory
I have this sketch:
const uint32_t len = 65536;
uint8_t arr[len];
void setup() {}
void loop() {}
The length of the array should fit into the dynamic memory. However, when I compile the sketch it ...
0
votes
1
answer
151
views
Problems with compiling more then one sketch in the Arduino IDE
I found this ESP8266-MQTT program on Github.
How can I compile this thing with the Arduino IDE?
I only can open one sketch at a time. If I try to compile this then parts of the program are missing for ...
2
votes
1
answer
1k
views
Arduino IDE - scope of the pre-processor "#define"
I'm creating an Arduino library and have 3 files - a "test.ino" program, and two library/class files: "testLibrary.h" and a "testLibrary.cpp".
The library makes use of ...
4
votes
1
answer
617
views
Does the compiled binary of a sketch include uncalled functions from a library?
I am writing a GUI using a TFT display and the Adafruit GFX library and its default font on Arduino Nano.
I want to be memory efficient and I assumed that the 'optimise for size' default setting of ...
1
vote
0
answers
99
views
How to compile Arduino Framework with GNU
I'm wondering if it's possible to use GNU (g++) to compile a arduino Sketch.
I wanna be able to unit test my code with catch2.
g++ -std=c++11 <filename> works well with catch2, but I obviously ...
0
votes
1
answer
4k
views
Can't use uint16_t in library
I wonder why the following minimal example sketch doesn't compile (unknown type name 'uint16_t'):
sketch_does_not_compile.ino:
#include "myheader.h"
void setup() {
char a[]="hello ...
0
votes
1
answer
89
views
Weird problem with arduino
I wrote the code below and the result is not what I expected at all! I'm not sure why it's happening!
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
const uint8_t ...
-1
votes
3
answers
2k
views
Is there an open source compiler for Arduino Sketch codes?
I am working on a web app to program some nodeMCU devices that were flashed with the arduinoOTA library.
http://esp8266.github.io/Arduino/versions/2.0.0/doc/ota_updates/ota_updates.html
I tried the ...
1
vote
1
answer
1k
views
Pass a char array to a function that uses File as parameter
I am in serious need for help here. I have a rather small function that get's the number of files from within a given directory. Now, the directory name (that is the path) is stored in a char array ...
0
votes
1
answer
713
views
Error Compiling to Board Teensy LC
I wrote a simple switch program using a teensy LC and transistors, but the Arduino compiler will not compile for the Teensy LC. And not for just my program, but any program, including the example ...
5
votes
1
answer
21k
views
Multiple definition of "..." Compiler Error
I am creating a simple library to test how multiple files in an Arduino program works. I have three files. MotorController.ino:
#include <motor.h>
void setup() {
motorInitialize();
}
void ...
1
vote
3
answers
1k
views
Arduino constant vs Microchip PIC constant
2.2 THE BASICS OF C PROGRAMMING LANGUAGE book is has like this,
CONSTANTS
A constant is a number or a character having fixed value that cannot be changed during program execution. Unlike variables, ...
0
votes
1
answer
77
views
smaller program bigger sketch
I'm working on a program composed by several classes.
I reduced the size of a single class of (more or less) one hundred lines (4kb of stuff)
I expected a smaller sketch but surprisingly it is ...
7
votes
3
answers
14k
views
Is there a constant for the Maximum Unsigned Long value in an Arduino compiler?
I am writing a timer function that uses the micros() function which generates a unsigned long value. To compensate for a roll over condition, I would like to use the maximum value for that variable ...
1
vote
1
answer
200
views
Compiling Error
I am trying to compile this code on arduino IDE...It showing error
code is
#include <IRremote.h>
int RECV_PIN = 6;
int led = 12;//1FE50AF
int led1 = 10;//1FED827
int led2 = 9; //1FEF807
int ...
0
votes
2
answers
19k
views
GCC msg "note: in definition of macro 'max'" error message
I'm using the ATtiny x5 series board, compiling my project (.cpp.ino file). Whenever I use the max(a,b) macro, I receive this message:
"C:\Documents and Settings\<user>\Local Settings\...
1
vote
1
answer
1k
views
Force compiler to execute instructions sequentially?
Is there a way to force the Arduino compiler to compile individual commands sequentially? Looking at the disassembly, lines of the assembly code for different C/Arduino commands are mixed. I was ...