A question about file extentions of tabs in IDE.


 i'm starting write larger sketches , finding out how important organization of code larger program becomes. i'm using arduino ide compsose code , started using tabs break code semi-managable chunks. when named tabs didn't give extention names (didn't know could). ide treat code if 1 big file.

 then learned little making them header files , "#include"ing them main sketch enables me isolate different sections of code , localize variables within them. useful!

 somewhere in learning section on arduino site  i came accross -

tabs, multiple files, , compilation:

allows manage sketches more 1 file (each of appears in own tab). these can normal arduino code files (no extension), c files (.c extension), c++ files (.cpp), or header files (.h).

 my question is, difference/use of using .c or .cpp extentions in tabs of arduino ide. there benifit in doing that. know libraries have have both .h , .c files. better off learning how write libraries. which, way, little confusing. can't seem find how write libraries doesn't asume reader has fair knowledge of c language.

a little babbling myself.
 i've been using c 5-6 months. used write programs in machine language on commodore 64 (yes i'm old). time windows 95 came out started using pc's , there software available didn't see need write programs anymore. but, i've been electronics since 9. when came across arduino while browsing internet geek in me had have one. i've got ideas i'd develope, maybe make buck or two. so, have start programming again  ::).

p.s. give arduino team devices they've created, allow rest of more , affordably create our own devices of future. (and in open-source movement)

quote
what difference/use of using .c or .cpp extentions in tabs of arduino ide.


i think you've learned answer that.
quote
enables me isolate different sections of code , localize variables within them. useful!


isolating code in separate files lets concentrate, in 1 file, on 1 aspect of program. writing lcd? why mix code through code reading temperature sensor , wind speed indicator , lighting leds? put in 1 file, , call functions in file. if doesn't work right, lcd code in 1 place, not spread on place.

doing project same lcd, different input devices? no need re-create code write lcd. you've got in re-usable file. known library.


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > A question about file extentions of tabs in IDE.


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums