I open this topic to talk about Arduino compiler in simulide.
If you have some ideas or find some problem, you can reply here.
One "problem" I often have is that I must remember to set the Board type if not the deafult Arduino Uno.
Many times I forget it, compile for Uno when I'm actually using a Mega and the sketch does not work.
To overcome this I did an small "hack".
In the future when projects are implemented, this may change, but by now it is useful:
To override the Board defined in properties you can add this in the first line of your .ino file (MUST be in the very first line):
Once you save the .ino file with this line, it will always compile for that board without changing it in the settings.
Also Information about the compilation is added at the end of arduino_build output:
Adding this first line:
- Arduino Board: Standard board selected in settings.
- Custom Board: Custom board selected in settings.
- In File Board: Board set in first line on .ino file.
This is available since Rev 473.
If you have some ideas or find some problem, you can reply here.
One "problem" I often have is that I must remember to set the Board type if not the deafult Arduino Uno.
Many times I forget it, compile for Uno when I'm actually using a Mega and the sketch does not work.
To overcome this I did an small "hack".
In the future when projects are implemented, this may change, but by now it is useful:
To override the Board defined in properties you can add this in the first line of your .ino file (MUST be in the very first line):
- Code:
// Board = BoardName
Once you save the .ino file with this line, it will always compile for that board without changing it in the settings.
Also Information about the compilation is added at the end of arduino_build output:
- Code:
Sketch uses 954 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 11 bytes (0%) of dynamic memory, leaving 2037 bytes for local variables. Maximum is 2048 bytes.
Build folder: /home/user/.local/share/simulide/codeeditor/buildIno
SketchBook: /home/user/Arduino
Arduino Board "arduino:avr:uno"
SUCCESS!!! Compilation Ok
Adding this first line:
- Code:
// Board = Mega
- Code:
Sketch uses 1582 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 11 bytes (0%) of dynamic memory, leaving 8181 bytes for local variables. Maximum is 8192 bytes.
Build folder: /home/user/.local/share/simulide/codeeditor/buildIno
SketchBook: /home/user/Arduino
In File Board "arduino:avr:megaADK"
SUCCESS!!! Compilation Ok
- Arduino Board: Standard board selected in settings.
- Custom Board: Custom board selected in settings.
- In File Board: Board set in first line on .ino file.
This is available since Rev 473.