Pages: [1]   Go Down
Author Topic: Ability to minimize sections of code in IDE  (Read 1764 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17262
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26420
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Norfolk UK
Offline Offline
Edison Member
*
Karma: 66
Posts: 2470
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Full Member
***
Karma: 11
Posts: 164
IDE for Microsoft Visual Studio and Atmel Studio 6.1, optional USB Debugger
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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/

Logged

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

Pages: [1]   Go Up
Jump to: