Questions tagged [compile]

To compile is to convert the code for a sketch into machine readable files that are uploaded to the Arduino. This tag is mostly used for the space and footprint of the files uploaded to the Arduino.

155 questions
45
votes
2 answers

Warning when verifying sketch with VS code

I use Visual Studio Code to develop for arduino which uses Arduino Studio installed files and needs the installation to work. This works very well. Annoying is that when verifying a sketch it takes longer than in the Arduino IDE. I suspect the…
Uwe Hafner
  • 1,031
  • 1
  • 9
  • 12
30
votes
6 answers

How to compile, upload and monitor via the Linux command line?

Interfacing an Arduino Uno (uploading etc.) with the Arduino IDE (using the Fedora package) works fine under Fedora 21. But I rather want to use vim + make + vim-quickfix-mode etc. How can I do that? Preferably via the tools available from the…
maxschlepzig
  • 531
  • 1
  • 4
  • 14
22
votes
2 answers

Why can't I declare a class in another tab in Arduino IDE?

I wanted to move some of my code out into a second tab in the Arduino IDE, to keep things better organised. At first, I only tried moving a function, and it seemed to work fine. I could call the function from the setup() function in my main tab, and…
Peter Bloomfield
  • 10,982
  • 9
  • 48
  • 87
15
votes
1 answer

Arduino IDE #ifdef

I use my Arduino IDE to either upload my sketch to a Arduino or ATTiny or ATmega328. As you know each device can have a different pinout. Does the Arduino compiler support ifdef, depending on the board I am connected to? For example #ifdef Attiny85 …
PhillyNJ
  • 1,178
  • 3
  • 10
  • 20
15
votes
1 answer

Is there a preprocessor constant for memory size

I would like my compiles to exclude some code depending upon the flash/program space available. To be used in the demo code of a library I support. Whereas my current solution is to use a #ifdef of processor type. But I would like to be more general…
mpflaga
  • 2,523
  • 14
  • 13
14
votes
4 answers

Why do sketches take up so much space and memory?

When I compile this sketch for the Yún: int led = 7; void setup() { pinMode(led, OUTPUT); } void loop() { digitalWrite(led, HIGH); } I get: Sketch uses 5,098 bytes (17%) of program storage space. Maximum is 28,672…
hichris123
  • 337
  • 1
  • 3
  • 19
13
votes
2 answers

Will a .ino Arduino Sketch compile directly on GCC-AVR?

Okay, we all have seen those questions all over the web such as Arduino v.s. C++, or other similar questions. And a vast majority of the answers do not even touch compilation differences other than through abstracted information. My question aims to…
RedDogAlpha
  • 190
  • 1
  • 1
  • 9
10
votes
1 answer

Setting timer3 in CTC mode - conflict with servo library

I would like to set up a timer in order to call a function 800 times per second. I'm using the Arduino Mega and Timer3 with a prescaler of 1024. To choose the prescaler factor I've considered the following steps: CPU freq: 16MHz Timer resolution:…
UserK
  • 559
  • 1
  • 11
  • 24
8
votes
6 answers

Compiling is slow

Compilation of even the simplest program (like Blink) is extremely slow, the progress bar often hangs halfway for nearly half a minute. Is this normal? I understand that not all computers are equally fast, but there's a huge difference between 3…
Joris Groosman
  • 1,191
  • 3
  • 11
  • 26
8
votes
2 answers

Is it possible to run a binary from EEPROM?

Say I wrote a compiled sketch to EEPROM then read it. Could I run the program from EEPROM? I guess the question is: Can an Arduino run software not in flash memory in the middle of executing the software in flash?
Piper McCorkle
  • 183
  • 1
  • 5
8
votes
3 answers

Manchester Library Won't Compile for Attiny85

I am creating a wireless sensor using an Attiny85. I want to send the data to an arduino uno, so I purchased the 315mhz rf link kit from spark fun. Since the Attiny85 does not have a TX I decided to use the Manchester library however it won't…
Joel
  • 523
  • 3
  • 15
8
votes
2 answers

Basic makefile for avr-gcc

I would like to make a makefile for compiling c programs for the arduino. I am somewhat familiar with make but have never used it with avr-gcc. What is the simplest way I could put the commands below in a makefile? $ avr-gcc -Os -DF_CPU=16000000UL…
connorwstein
  • 183
  • 1
  • 1
  • 4
7
votes
4 answers

How to add hysteresis to threshold values?

This code compares the analog input value against two thresholds, having three voltage regions. Then it will turn on an LED according to what region the read voltage is in. The problem is that when the voltage read is very close to the threshold,…
Andy
  • 103
  • 2
  • 2
  • 7
7
votes
1 answer

Warning Arduino CMakeLists "Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES"

I'm trying to build an Arduino example without using its IDE. My OS is Windows 8.1 and I'm using the last version of CMake (2.8.12.2) and MinGW (GNU Make 3.82.90). I downloaded the Arduino CMakeLists and I learned all about make/upload any firmware…
fenix688
  • 173
  • 1
  • 7
7
votes
2 answers

Is there a way to upload precompiled code to an arduino?

My company is developing a programmable remote control car which is driven by an Arduino Nano. We would like a way for the user to install software updates to the Arduino, but we don't want to give the user access to the code. Is there a way to…
TheIronKnuckle
  • 211
  • 1
  • 3
  • 6
1
2 3
10 11