Go Down

Topic: Ability to minimize sections of code in IDE (Read 2030 times) previous topic - next topic

B0arder606

Newcomer here.  I've been working on my first project that has quite a bit of code.  I come from coding in microsoft visual studio where you can minimize sections of code.  I think this would be a great feature to have in the IDE as I would like to be able to minimize sections of code that have been debugged.  It would make a much cleaner approach at coding - at least for me.

Sorry if this has already been brought up.

retrolefty


Newcomer here.  I've been working on my first project that has quite a bit of code.  I come from coding in microsoft visual studio where you can minimize sections of code.  I think this would be a great feature to have in the IDE as I would like to be able to minimize sections of code that have been debugged.  It would make a much cleaner approach at coding - at least for me.

Sorry if this has already been brought up.


No such function presently in the IDE. However there are tapped sections where you can place separate functions that will be added with the main sketch prior to starting compilation.

Lefty

CrossRoads

You can use Tabs to split up your code. Functions, like retrolefty suggests, or just find convenient places to split your code.
I had a 13K (compiled) program, I split it thusly:
program_name (where I had notes)
a_presetup (library calls, pin assignments, variable declarations)
b_setup (pinModes, Serial.begin, SPI.begin kind of stuff)
c_void_loop
d_more_void_loop
e_end_void_loop
f_pitches  (was using Tone Library, this held the note frequencies)

Didn't have any functions, but had to pay attention where the closing } for void loop ended up.
Compiler seemed to be happy compiling by tab name, and program flow followed the tabs as well.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Riva

Set the Arduino IDE preferences to use an external editor, download Notepad++ and add the Arduino specific references as shown in this thread http://arduino.cc/forum/index.php/topic,112662.0.html You will be able to fold/unfold.

Graynomad

You're referring to "code folding", I doubt the IDE will ever do that. I also use Notepad++, once you've used it (or something similar) you'll never go back :)

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Visual Micro

If you are used to Visual Studio then try the free Arduino plugin. It does everything the arduino ide does and a bit more.

Fully compatible with the arduino ide. Read more here http://www.visualmicro.com/

Arduino for Microsoft Visual Studio Pro and Atmel Studio 6.1 http://www.visualmicro.com
Arduino Debugger http://www.visualmicro.com/post/2012/05/05/Debug-Arduino-Overview.aspx

Go Up