Hot answers tagged

9

The Arduino IDE command line predates arduino-builder and was made available when the source pre-processing and compiling was implemented by a Java class (deeply) embedded in the IDE. The current IDE uses arduino-builder behind the scenes to process and compile the code so if you use arduino-builder you avoid having to load the whole Java IDE. Try it out it ...


9

I would use conditional compilation, like this: #ifndef(ARDUINO) // Non-Arduino code. #endif


8

In theory, an Arduino board could be used in some low-end professional products (i.e. where the performance and memory limitations aren't an issue). The build quality of the official boards is certainly good enough. The only issue they would potentially have is making suitably robust connections -- i.e. anything plugged into a female header would have the ...


6

Yes, you can also use an Arduino for professional usage. The Arduino is actually just a prototyping device and easy to use for people at home/school. I suppose there might be products on the market which were developed using an Arduino. But the most important thing is the Atmel MCU inside the Arduino which can be used for anything. But, if you wanna know if ...


6

As I turns out, the avr-gcc (GCC) 4.9.1 goodies weren't being used at all! The arduino package was using a decrepit version of gcc, prakhar@sim74stic ~ $ /usr/share/arduino/hardware/tools/avr/bin/avr-g++ --version avr-g++ (GCC) 4.3.2 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO ...


6

For the most part, none of the AVR based arduinos are any better at number crunching than any others. They all have a single AVR core running at 16Mhz. None have an FPU, but the software floating point code is very efficient and at the time scales you care about for a calculator, it really doesn't make much of a difference. The biggest differences between ...


5

Start with the biggest (AVR) Arduino you can afford, and worry about miniaturizing it once you have the basics in place. You may find that you don't actually want an Arduino in the end, but something like the ATmega169PA instead so that you have native LCD support (instead of having to use a discrete LCD module). P.S. I have some experience with x86 ...


4

See my post about How the IDE organizes things. Also see my page about how to avoid the quirks of the IDE sketch file pre-preprocessing. You can certainly manage without .ino files. As Edgar Bonet says, they are really C++ files with certain pre-processing (see link above). but what about these loop() and setup() functions Effectively, the Arduino IDE ...


4

arduino has its own little .ino preprocessor that generates forward declarations (like in a header file) for all function in the project's .ino files. Most of the time this just makes things less confusing for new users. I'm not familiar with the entire process, but the effect is that any function in any .ino is known to all other .ino code. Anything with ...


4

The typical way to achieve what you want would normally be to create your own subclass of OneWire class and override the methods you need to change, then pass a pointer to an instance of your class to the DallasTemperature constructor. However, for this to work, the OneWire class must have been developed with extensibility (subclassing) in mind, i.e. use ...


3

If I remember correctly this is in fact a limitation of the Arduino IDE. If you use a better IDE (personally I use Eclipse with the Arduino plugin) it works as it should, i.e. if you include a library A that includes another library B, then in the end you won't get compile-time errors and both B and A will be included in the final binary.


2

According to the release notes starting with V1.5.2 of the IDE you can verify and upload from the command line. You could use your favorite editor and then use the command line to do the arduino build/upload instead of the IDE. See: https://github.com/arduino/Arduino/blob/ide-1.5.x/build/shared/manpage.adoc I have not used it so I can't say if it work ...


2

Yes, I work for an engineering design house and we use Arduino frequently to prototype ideas for clients. It significantly speeds up the time to get a proof-of-concept device in the hands of the client and their potential investors. We have found though that there is significant work to get from an Arduino-based prototype to a commercially-ready product. ...


2

Make a new tab in the IDE (top RH corner) with a xxx.cpp file name. Put your code in that. Leave the .ino file blank. Then it will compile. You need to add: #include <Arduino.h> ... to the start of the .cpp file. More information: How to avoid the quirks of the IDE sketch file pre-preprocessing To clarify the question about libraries ... You do ...


2

Unfortunately there really isn't any way of doing that other than modifying those files. The good news is that it is perfectly viable to make the modifications under a different "core" and then amend boards.txt with the core containing the modifications.


2

Any Arduino (I would start with the UNO) will be sufficient to make a calculator similar to the regular HP or TI calculator product line. For the keypad, you will need to buy an I2C compatible keypad and connect it to the I2C lines. For the screen there is an LCD shield. You will not need to code anything in assembly. You can write cpp code using the ...


2

Turn on Verbose Compiling in the Arduino IDE and you will see all the intermediate file names (they are done in a temporary folder). For example: /home/nick/Development/arduino-1.6.7/arduino-builder -dump-prefs -logger=machine -hardware "/home/nick/Development/arduino-1.6.7/hardware" -hardware "/home/nick/.arduino15/packages" -hardware "/home/nick/Arduino/...


2

You need a common place that the building of all the places can get the definition from. That isn't the sketch. The sketch is one of the things that would have to look at that common place. That can either be a single shared header that everything else (that needs it) includes, or it can be a -D flag added to the compilation command. For instance, adding: ...


2

Have you tried placing the H file in the same folder as you main cpp file. This should prove beyond all doubt that there is nothing wrong with the code (I can't see anything wrong). I suspect its a path issue. You need to check that Eclipse is setup up properly to source the libraries from you custom location. Also it needs to be passing this location on ...


2

There are four variants of LwIP bundled with the ESP8266 core: V1.4 (Compile from source) V1.4 (Precompiled) V2 Lower Memory V2 Higher Bandwidth By default (for most boards) one of the V2 variants is selected. You need to change that to the V1.4 (Compile from source) for it to use the version that you have modified.


1

The line in your boards.txt: build.f_cpu=1000000L created a separate board entry with the board ID build, thus the error message: Warning: Board Move38:avr:build doesn't define a 'build.board' preference. Auto-set to: AVR_BUILD From your comment: # set F_CPU to 1Mhz for all boards on this platform and your answer I see that you expected that line to ...


1

It appears that you can no longer set a global property in the boards.txt file. You must set every property individually inside each board ID, even if they are the same for every board in the file. This seems to contradict the documentation that states that... The other properties will override the corresponding global properties of the IDE when the ...


1

Good to hear you are splitting large amount of code, it will benefit you a lot in the long run. It's very hard to say what is best, it depends on the interaction of those patterns with other classes. Normally it is best to put them in the location where they BEST belong to, i.e. where the least association with other classes exist. If it has a lot of ...


1

Yes you can have multiple files without classes. Functions don't have to go in classes, see loop and setup for an example. All you have to do is declare the function in a header file and then implement it in a body. so: // File Bob.h #ifndef __BOB_H__ #define __BOB_H__ int SomeFunction(const char val); #endif // __BOB_H__ // File Bob.cpp #include Bob....


1

I noticed that it is very hard to use classes with the default IDE. Each file will be in a different tab, but normally each class has a header (.h) and implementation (.c) file, so 2 extra tabs per class. If you have just 3-4 classes you can use the default IDE. However, if you want to use more, you have to use e.g. Eclipse or Visual Studio, whatever IDE ...


1

There are two things you need to do: Compile the sketch into a .HEX file Upload the sketch to the board The first part can be done with arduino-builder which is part of the IDE since 1.6.6, or you can use one of various Makefile projects on a platform that supports make, or you can manually script it yourself calling the correct avr-gcc and avr-g++ ...


1

In the Arduino IDE preferences, select external editor. Then you can write/ edit your sketches with any editor you choose. When you click compile or upload on the IDE toolbar, it will load your changes each time you compile.


1

Open preferences.txt in C:\Users\YourUserName\AppData\Roaming\Arduino and change the path of sketchbook.path=C:\Users\YourUserName\Documents\Arduino to sketchbook.path=YourDesiredPath.


1

That is a tough one... Because arduino-builder is basically a custom go script you don't get the facilities you get in a Makefile, like shell execution. I would be inclined to do this kind of thing outside that environment - use some external program or tool to generate a config.h file (maybe use something like GNU Autotools) that contains your custom ...


1

I've written a new option for Arduino CI/unit testing and put together a decent size writeup about it as an answer to this related question. I ended up using the Arduino command line instead of arduino-builder, because it worked better cross-platform for me. It assumes a graphical display though, even if you just use the CLI features. In the case of ...


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