Want to learn "C" - Page 1
Forum section: electronics / general

author: alan monro
author_rank: Contributor
timestamp: September 30, 2012, 12:12:14 am
content: Would anybody please tell me if there is a better book than "C" for dummies as there are many projects I wish to make using the Arduino . I have already have a evaluation board and have programed a flashing led , but , that is only the smallest fraction of what that powerful computer can do. Thank you, ..............................Alan

author: nctnico
author_rank: Super Contributor
timestamp: September 30, 2012, 12:42:45 am
content: Well there is "the C language by Kernigham & Ritchie":http://zanasi.chem.unisa.it/download/C.pdf. This is written by the inventors of the C language. Some regard this book as the ultimate C bible because there is no book closer to the source of the C languageBesides that a good way to learn is to look at software other people wrote. Some examples are bad and some are good so when looking for a solution make sure to look at at least 5 different solutions and pick one that looks uncomplicated and you can understand.

author: oldrose
author_rank: Contributor
timestamp: September 30, 2012, 12:46:37 am
content: Every C programmer should have "The C Programming Language" by Kernighan and Ritchie and I highly recommend "A Book on C" by Kelley and Pohl.

author: IanB
author_rank: Super Contributor
timestamp: September 30, 2012, 12:47:47 am
content: Tread carefully though: Arduino sketches are not written in C, even though the language is similar.

author: updatelee
author_rank: Contributor
timestamp: September 30, 2012, 01:45:42 am
content: I learned in University on the Deitel and Deitel books, they are excellent.UDL

author: JuiceKing
author_rank: Regular Contributor
timestamp: September 30, 2012, 03:42:28 am
content: K&R is the reference, and important as it is to read and own, if it were perfect there wouldn't be so many other books trying to supplement it. The book Deep_C_Secrets helped me understand C better than any other. It's context is way out of date, but the concepts that it explains are timeless. I'm sure it's out of print, but maybe a search in Amazon or Abebooks will turn up a copy.

author: poptones
author_rank: Frequent Contributor
timestamp: September 30, 2012, 05:05:20 am
content: http://kat.ph/expert-c-programming-deep-c-secrets-peter-van-der-linden-pdf-t6506890.html

author: Pagweb
author_rank: Newbie
timestamp: September 30, 2012, 06:51:53 pm
content: I learned C at my university too. The book we used was 'Problem Solving and Program Design in C' by Hanly Koffman. Is a good book for beginners and it has examples and practice problems. You can get a used version in Amazon for like $10.

author: grumpydoc
author_rank: Super Contributor
timestamp: September 30, 2012, 07:00:04 pm
content: K&R is probably my favourite book onanyprogramming language. It sets out to describe the C language and does so with the minimum of fuss and extraneous detail.It helps that K&R C is a very compact language - ANSI C has bloated somewhat and C++, much as I like it, is actually a nightmare.It is an excellent example of the Unix philosophy of "one task, done well" and I thoroughly recommend it if you are learning C.However you also need a good reference on the platform - modern systems are much more than the programming language and you need to know as much about he environment as possible to make effective use of it.

author: Bored@Work
author_rank: Super Contributor
timestamp: September 30, 2012, 07:03:23 pm
content: Quote from: poptones on September 30, 2012, 05:05:20 amOh, come on. One doesn't become an expert out of nothing by reading an expert/secret book. Such books are snake oil.

author: mtkaalund
author_rank: Contributor
timestamp: September 30, 2012, 07:57:29 pm
content: Quote from: IanB on September 30, 2012, 12:47:47 amAnd what do you based that on?The arduino "language" is just a framework, that you program around, but it stil uses AVR-GCC and AVR-LIBChttp://arduino.cc/en/Hacking/BuildProcess

author: Simon
author_rank: Unknown
timestamp: September 30, 2012, 08:04:16 pm
content: I got a book called "programming in c" by Stephen kochan it is very good. To be honest just reading others programs won't help one little bit unless you know so c, I'd prefer a less compact language, in the long run it would be faster for me to use and understand.

author: IanB
author_rank: Super Contributor
timestamp: September 30, 2012, 08:33:31 pm
content: Quote from: mtkaalund on September 30, 2012, 07:57:29 pmI base it on the link you provided.The C programming language consists of the standard language syntax and standard set of libraries (with a corresponding set of standard named header files).The Arduino programming language uses different libraries and header files and macro definitions, and it also includes elements of C++ (which is not C).So although programming an Arduino may be similar to writing C, it is not C. If you try to work through K&R and follow the examples and exercises as given you will run into trouble.An experienced person may be fully aware of this, but it is not something that may be equally clear to beginners.

author: TerminalJack505
author_rank: Super Contributor
timestamp: September 30, 2012, 09:12:51 pm
content: I have to agree with IanB here. Strictly speaking sketches are neither C or C++. This can really trip-up a newcomer. For good or bad Arduino sketches are their own little beast.For example, try putting astructdeclaration in your Arduino sketch. It won't work. It does in C/C++. Someone trying to learn C or C++ will find this very frustrating.Someone who already knows C/C++ will find this merely quirky. (A 10-second Google search reveals that the workaround is to simply put the declaration in a .h file.) A noob will likely waste countless hours with a problem like this, however, and will likely come away feeling duped into thinking that Arduino sketches are "just" C/C++ code.

author: phil_jp1
author_rank: Regular Contributor
timestamp: September 30, 2012, 09:42:23 pm
content: It's has been mentioned earlier and I will repeat it:Apart from reading a book(doesn't matter how good that book would be), you should learn from others code! Learn design patterns in process.Another really good way to learn is to take someone's code, compile it to see if it works, then change something and compile it again, pay attention to compiler generated errors and warnings, fix the problems and run the program, then repeat this cycle again.

author: JuiceKing
author_rank: Regular Contributor
timestamp: October 01, 2012, 01:04:49 am
content: Quote from: Bored@Work on September 30, 2012, 07:03:23 pmSince I recommended this book, I'll defend it. The author, Van Linden, managed the compiler team at SUN, and many of the "secrets" he reveals are things that anyone who has actually implemented a compiler would know. If you don't have this experience, the insights might be hard to come by otherwise. His introductory book on Java (also badly dated now) was similarly great.

author: alan monro
author_rank: Contributor
timestamp: October 01, 2012, 06:30:21 am
content: Quote from: oldrose on September 30, 2012, 12:46:37 amThank you....................Alan

author: alan monro
author_rank: Contributor
timestamp: October 01, 2012, 06:32:53 am
content: Quote from: nctnico on September 30, 2012, 12:42:45 amThanks to everybody who gave suggestions..............................................Alan

author: alan monro
author_rank: Contributor
timestamp: October 01, 2012, 06:36:32 am
content: Quote from: oldrose on September 30, 2012, 12:46:37 am

author: T4P
author_rank: Super Contributor
timestamp: October 01, 2012, 07:12:56 am
content: Quote from: Bored@Work on September 30, 2012, 07:03:23 pm

author: Kremmen
author_rank: Super Contributor
timestamp: October 01, 2012, 06:22:30 pm
content: My 2 cents worth: while not strictly an elementary instruction book, the "Elements of C Programming Style" by Ranade and Nash can be worth checking. Most of the guidance given in there is as valid today as the day it was written. Works for me at least.

author: Ferroto
author_rank: Frequent Contributor
timestamp: October 02, 2012, 12:10:32 pm
content: Even better then a book.

author: alan monro
author_rank: Contributor
timestamp: October 02, 2012, 10:14:40 pm
content: Thanks Ferroto.....................................Alan

author: andyturk
author_rank: Frequent Contributor
timestamp: October 04, 2012, 09:23:44 pm
content: Quote from: Ferroto on October 02, 2012, 12:10:32 pmUgh. That's the thing with IDEs--you spend an hour screwing around with project and Makefile creation before you can even get to running some C code. Yuck.Back around the time when dirt was invented, I learned C on a PDP-11 running Unix. I had a copy of K&R on the desk beside me and worked through simple examples in minutes using just a command line:$ ed hello.ca#include <stdio.h>int main(int argc, char *argv) {printf("Hello World!\n");}.wq$ cc hello.c$ ./a.outHello World!$The same thing still works on my Mac today. Woo hoo!You kids can keep your IDEs.

author: Kremmen
author_rank: Super Contributor
timestamp: October 05, 2012, 07:25:03 am
content: An hour is a long time (for IDE setup)? Do you honestly know a single SW project that failed because the IDE took so long to set up?There are pros and cons for IDE and non-IDE project setup. Some advanced things are a bit difficult to do in an IDE environment but your basic project dependencies, tool parameterization and build is not one of them. That is one big reason why i find myself doing everything in an IDE these days (at least for AVR-GCC projects).Some like to bash e.g. the AVR Studio in its different versions but i can live with it quite nicely. And as to project setup, it takes all of ca. 10 seconds and you are good to go. For me it is a big value that the IDE lets me concentrate on solving the software creation task, not mess with tool setup and operation at every iteration.

author: glee
author_rank: Contributor
timestamp: October 05, 2012, 09:50:57 am
content: I'd suggest that the book that's right for you depends on your previous programming experience. If you are an experienced coder in other languages, you may find yourself empathising with those that hold K&R in such high esteem. If this is your first exposure to a low-level language you may find that same book a little opaque, or at least not very "tutorial" in style. I think I would give a second endorsement for "Programming in C" by Stephen Kochan for someone new to programming attempting to learn C.

author: andyturk
author_rank: Frequent Contributor
timestamp: October 05, 2012, 02:18:28 pm
content: Quote from: Kremmen on October 05, 2012, 07:25:03 amNo, of course not.IDEs are fine, but I think of IDEs as a nice-to-have rather than a requirement, as long as they don't interfere with automated builds. For learning though, there's a lot to be said for going back to basics, especially with C. When you're learning, it's usually with small programs that demonstrate particular language features. IDEs, on the other hand, are designed to handle large sprawling programs that a beginner shouldn't have to deal with.

author: aluck
author_rank: Regular Contributor
timestamp: October 05, 2012, 04:09:05 pm
content: Quote from: JuiceKing on October 01, 2012, 01:04:49 amSpectacular book! I wonder why it is not very popular and widely-known.

author: Kremmen
author_rank: Super Contributor
timestamp: October 05, 2012, 08:37:11 pm
content: Quote from: andyturk on October 05, 2012, 02:18:28 pmSure, an IDE is hardly mandatory - at least i am not aware of any environment save possibly the Arduino, where you _must_ have an IDE. But i don't quite get why an IDE would interfere with an automated build, rather it will facilitate such builds by creating the dependencies automatically.QuoteWhen one is a beginner and learning the basics of a programming language i would think an IDE is just the thing to have. That way the poor beginner is somewhat isolated from the possibly complex machinery of a build. When he/she later wishes to understand it - if ever - many IDEs provide a view to that as well. And if not, there is always the fully manual option...

author: nctnico
author_rank: Super Contributor
timestamp: October 05, 2012, 09:13:37 pm
content: And lets not forget a good IDE has a good editor which lets you rename variables and functions across several files, keep a history of changes, does code completion, shows which functions are in a file, where variables are declared, etc, etc. A good IDE should make dealing with the source code much easier.

author: andyturk
author_rank: Frequent Contributor
timestamp: October 05, 2012, 11:17:57 pm
content: Quote from: nctnico on October 05, 2012, 09:13:37 pm<voice=Dave>No! Noooooo!</voice>Emacs uber alles.

author: majorkuso
author_rank: Contributor
timestamp: October 05, 2012, 11:30:01 pm
content: Since you are starting with the arduino I would recommend this book Beginning Arduino Programming by Brian Evanshttp://www.amazon.com/gp/product/1430237775/ref=ox_sc_sfl_title_4?ie=UTF8&smid=ATVPDKIKX0DERIt contains examples and explains loops easily and if I remember right goes into arrays. I have it and I highly recommend it until you get used to the loops and syntax of the arduino then when you feel you have accomplished it enough you can move on to c or c++ for more power, I have yet to move on due to lack of time to continue, but I am still young so I will learn as I go.

author: alan monro
author_rank: Contributor
timestamp: October 06, 2012, 03:12:56 am
content: Thank you for your trouble ,I did not know the book existed , now I know.I will certainly purchase it . Thanks.........................Alan

author: Markybhoy
author_rank: Regular Contributor
timestamp: October 07, 2012, 05:46:47 pm
content: Im going to try and learn C and picked up a book that looks good for beginners, its called C Primer Plus by Stephen Prata.Its aimed at beginners and I like it because it has loads of exercises at the end of each chapter to practice.There is also free video training here -http://www.wibit.net/curriculum/the_c_lineage/programming_in_cAnd a free course starting soon from Harvard covers C programming -https://www.edx.org/courses/HarvardX/CS50x/2012/about

author: Simon
author_rank: Unknown
timestamp: October 20, 2012, 11:57:09 am
content: If you want to learn C DO NOT touch the arduino! It is a variant and just mess you up when you want to do proper c. I'm awful at programming but ditched my arduino early on and am now using mikroc, it's not perfect but free for home use and usable.

author: Kremmen
author_rank: Super Contributor
timestamp: October 20, 2012, 12:48:34 pm
content: People keep saying this but i have yet to notice any significant variation. Of course there is the detail that Arduino is actually programmed in C++ so compared to C, yes it varies a lot, but not in an Arduino specific way. As far as i have seen, it is standard C++ as implemented by AVR-g++. All of the Arduino quirks are actually just its standard library functions that anyone can implement, nothing "closed" about those at all. SOme time ago i did a camera dolly controller using Arduino. Not being an Arduino enthusiast as such, i wrote the code in straight C++ with dynamically allocated class instances etc etc and no regard for any "variations" due to it being Arduino. It all worked just as in any other C++ environment. So until proven otherwise, i maintain that Arduino is programmed with straight C++ with a bunch of libraries included in the deal.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 20, 2012, 12:52:57 pm
content: Quote from: Simon on October 20, 2012, 11:57:09 ami agree. but why?Quote from: Simon on October 20, 2012, 11:57:09 amoh here! reason and evidence? and what is the meaning of "proper c"?i agree that you should not touch arduino when learning C is because arduino is more hardware specific, ie you also need to learn what pins, what definitions and how the mcu functions, which will drag you away from your main() objective.Quoteif you want C, just use C syntax. if you want C++, you may use C++ syntax, its been like that for centuries.

author: Kremmen
author_rank: Super Contributor
timestamp: October 20, 2012, 01:25:42 pm
content: Quote from: Mechatrommer on October 20, 2012, 12:52:57 pmKinda hard to anything else, if you think about it. Actually, if you want C++, you _must_ use C++ syntax - - duh.QuoteYes, it is a commonly known fact that Leonardo da Vinci wrote the first C++ compiler for his wooden Personal Abacus in 1502 while working for the Borgias in Florence, the better to calculate ballista trajectories.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 20, 2012, 01:33:24 pm
content: Quote from: Kremmen on October 20, 2012, 01:25:42 pmi dont know which one i used when programming C or C++. i never had issue compiling them with only one compiler, except there will be slight option adjustment and that mysterious "extern C" thing. i guess its like C++ is totally a different thing from C? if that so then yes... arduino is not C, but C++

author: Kremmen
author_rank: Super Contributor
timestamp: October 20, 2012, 01:57:05 pm
content: You need the "extern C" thing to instruct the compiler to use C calling convention. Among other things, C and C++ do function name mangling differently, C++ to support polymorphism and whatnot, and of course C does not know anything about that.Afaik Arduino uses g++ by default, so everything is considered C++, although basic statements are identical for C and C++ so it is hard to see the difference right away. Then again, if you compile everything from source, you should not need the extern C pragmas because everything would observe C++ calling conventions naturally. It is only if you have precompiled modules in object format that you need to link to.

author: JuiceKing
author_rank: Regular Contributor
timestamp: October 20, 2012, 04:45:21 pm
content: If you try to learn C from, say K&R, on the Arduino, you will run into problems right away. No printf function! Yes, if you know what you are doing, you can work around this with the primitive print function over the port back to your computer, but that's not something I would wish on a beginner learning C from a book...

author: Unknown
author_rank: Unknown
timestamp: October 20, 2012, 05:04:18 pm
content: The lack of interactive debugging might also be an obstacle. It can be very instructive to step through a loop or function call in a debugger and watch all the variables change or go out of scope. Most of the uC development environments feature in circuit debugging, but the Arduino lacks any real debugging support.

author: Kremmen
author_rank: Super Contributor
timestamp: October 20, 2012, 05:19:52 pm
content: Quote from: JuiceKing on October 20, 2012, 04:45:21 pmSigh. Please try to speak about the right thing. printf() has got nothing to do with C language as such. It is just one of the runtime library functions. Implemented in some environments but not in others. Arduino does not implement it out of the box, but if you want it, just grab the source from somewhere and compile it. Of course you need a file system for printf() to work correctly so next you need to implement that. Wait, no hardware to support storage or text I/O so you need more... but you get the picture. Lack of printf() is not specifically related to C language.In Arduino you can use the write() and writeln() functions instead. Formatting is different but who cares. You want to print - print it on the PC screen.Quote from: alm on October 20, 2012, 05:04:18 pmWrite and printf are essentially equal for debugging, but neither comes close to a proper debugger. The Arduino IDE is a program development and load environment and imo that is the limit of skills of most Arduino users, who are mostly not "real" programmers. But at least Uno and maybe some others come with the standard ISP header, enabling DebugWire support if you have a suitable debugger, say JTAGICE 2 or some such. Of course that is not part of the free Arduino package. I guess the point is that all toolchains need some kind of hardware support.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 20, 2012, 06:14:43 pm
content: i believe there's confusion between C... (1) language set, (2) standard library functions, (3) IDE interface. lets dont talk about how compiler "mangles" things, thats #4. and i wont say much about them except imho, they are 3 distinct entities. lack of (2) and (3) doesnt mean that its not the "language", afaik. if you expect printf to be a C, then how do you expect atMega256 printf something? out of its butt?want printf? do it on a complete system with monitor or printer, a PC! and a console! but then, you dont expect printf will show you something on a "Windows" what you see on your screen right now. Windowed or mCU peripherals or such for that matter are another whole story not relating to "C", if you expect them to be, than you can buy a train ticket to DissapointmentVille. K&R guide always been for consoled PC such as DOS, so use it and do it there! want to do C for embedded mCU? buy a "C for embedded mCU" book from Mr Ritchie if you can find one.now, are we talking Arduino "IDE"? well its nothing but to waste people's time, if you got to know it better. lack of debugging tools is one thing, most annoying is how inefficient it makes compilation even for a simple application, its so damned slow. nothing more to say about it.

author: Simon
author_rank: Unknown
timestamp: October 20, 2012, 06:45:03 pm
content: Quote from: Mechatrommer on October 20, 2012, 12:52:57 pmfor starters every arduino sketch repeats itself, with c you have to "do something" to make a program loop

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 20, 2012, 06:55:48 pm
content: Quote from: Simon on October 20, 2012, 06:45:03 pmare you talking about main()? here i searched for you... check your ...\Arduino\hardware\arduino\cores\arduino folder its main.cpp...Code:#include <WProgram.h>int main(void){init();setup();for (;;)loop();return 0;}thats the entry point. doesnt that look like C or something to you? the arduino team has made it easy for you, you dont have to repeat that same "semantics" in your every project file.

author: Simon
author_rank: Unknown
timestamp: October 20, 2012, 06:57:34 pm
content: well it depends on what you want the arduino for, if your using it as a base for moving to C you may be learning twice, if you just want to do arduino then go right ahead

author: Kremmen
author_rank: Super Contributor
timestamp: October 20, 2012, 07:00:36 pm
content: Quote from: Simon on October 20, 2012, 06:45:03 pmAnd as in any other C or C++ program, it is done in the file main.cpp, that you can in this case find in folder C:\Program Files\arduino<ver>\hardware\arduino\cores\arduino:#include <WProgram.h>int main(void){init();setup();for ( ; ; )loop();return 0;}So the setup() and loop() are declared as externals and defined in your application. But it is the (otherwise invisible) main program that does the looping.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 20, 2012, 07:07:52 pm
content: you making duplicate post Kremmennext exercise... find the init()

author: Kremmen
author_rank: Super Contributor
timestamp: October 20, 2012, 07:14:50 pm
content: Oh, right. Didn't see that before posting.init() is declared in wiring.h and defined in wiring.c.

author: IanB
author_rank: Super Contributor
timestamp: October 20, 2012, 07:23:52 pm
content: Quote from: Kremmen on October 20, 2012, 05:19:52 pmHowever, printf() is part of the standard library and along with the rest of the standard library is described precisely by the language standard. A standard-conforming C implementation is expected to provide the standard library exactly as specified. If you have a C compiler without all the components defined by the language standard you don't have a proper C environment and you can't follow examples from a C tutorial.As has been stated above, this is something that experts may understand and take in their stride, but it is something that may be confusing for a beginner. If you cannot pick up a copy of K&R and work through all the examples and exercises as given, you don't have a working C environment.

author: Kremmen
author_rank: Super Contributor
timestamp: October 20, 2012, 08:01:15 pm
content: Well. printf() comes as a standard in some environments and not in others. It is a library function and has zip to do with the core language definition. It is included in environments that naturally support files and streams. Also,and perhaps mor to the point, it has zip to with the compiler, exactly because it is not a builtin language construct, but a _library_ _function_. Someone long ago decided that it would be nice to print things on console and into files and included that in the stdlib and yes, in the part of standards describing stdlib. But if you don't have a console and don't have a file system, printf() is about as useful as the pope's balls. That's why you seldom find it in an embedded development environment.K&R is a good if old source (it does not describe the current C standard) and its examples reflect that fact. But if you sorely must have printf() in Arduino to run the examples, there is no technical reason why it cannot be done. It will be needlessly wasteful of the meager resources but it definitely can be done.I disagree with your last statement. Presence of printf() in stdlib does not define a working C environment. In fact i am not sure if all the K&R examples would even compile as written, using a recent (say C99 or newer) standard compiler. But i haven't checked and don't really care.

author: JuiceKing
author_rank: Regular Contributor
timestamp: October 20, 2012, 09:35:30 pm
content: Quote from: IanB on October 20, 2012, 07:23:52 pmExactly.

author: andersm
author_rank: Super Contributor
timestamp: October 20, 2012, 10:00:52 pm
content: Quote from: IanB on October 20, 2012, 07:23:52 pmThat's true of hosted implementations. Freestanding implementations only have to provide <float.h>, <limits.h>, <stdarg.h>, <stddef.h>, <iso646.h>, <stdbool.h> and <stdint.h>.

author: westfw
author_rank: Super Contributor
timestamp: October 21, 2012, 02:32:02 am
content: And in fact arduino has printf() (or will allow you to use printf()), but you'll have to set it up in mysterious ways before you can use it (sort of like using JCL to define the IO of your ForTran programs on the IBM mainframe.)Look, there are about three pieces...1) There is the syntax of the C language itself. Syntax, Functions, Variables, control statements, operators, and so on. This is probably best learned on a desktop, with a debugger handy, using a reference like K&R. There are a bunch of principles here common to many computer languages. If you've programmed in any other language before, or had one of the "Computer Science 101" classes, this should not be all that strange. If you don't have ANY programming background, you might want to look around for a basic programming or computer science class (exact language not too important.) Be aware that many classes, and books, jump right into manipulation of images on your desktop screen, because that's the fun part.2) There are a bunch of concepts that are key to programming microcontrollers that aren't so common in desktop environments. IO Registers. Bit Masks vs bit numbers, bit shifting, and bit-banged IO. Volatile variables. Memory limitations. Interrupts. Concurrency (and the lack thereof.) The low speed of some peripherals. Locations that you write a 1 to to set them to zero. What peripherals do and what are their limitations. The fact that exit() isn't going to stop your program, and terrible bugs aren't going to put a nice error message on your screen.This is probably the hardest part. If you have a chip/electronics/assembler background, it's not too difficult to add to the basic C knowledge, but books and tutorials that deal with these things are a lot rarer than books on Excel...3) A particular environment will have a set of library functions that it uses for doing environment-specific things. This is true whether you're talking about Standard C functions like printf(), Posix functions (an operating system standard), arduino, cmsis, Atmel Software Framework, Stellarisware, or whatever. Arduino gets some negative press for "hiding important things that you should learn", but I don't see that it's that much different than vendor-provided libraries. (A vendor training video I watched recently had a sample program that used both LED_Toggle(LED0) and gpio_toggle_pin(NHD_blahblah_BACKLIGHT). Both to blink LEDs...) Arduino uses the same standard avr-libc that most people programming AVRs in C end up using, and adds some additional functions.A lot of "modern" programming seems to be about learning what library functions exist, and how to get them and use them. Cause those GTK windowing classes are so much more advanced than the KDE `toolkits, you know. (not that this is really "modern"; back in the Fortran/COBOL/PL1 days, a lot of learning a language was about using the IO facilities of the language. But in those days those were part of the language, while now you can pick and choose different libraries that behave somewhat differently.)And that will get you started. You still won't be able to immediately connect up that weird 9 DoF sensor chip and make an autonomous quadcopter assassin-bot, because you'd need to understand how that chip works (unless someone else has already done it and is willing to share their code, which is somewhat more likely in the arduino world than anywhere else these days.) And even after you've done that, autonomous robot assassins are hard research projects that DoD pays large teams big bucks to try to figure out...QuoteAnd one of the first things you need to learn if you want to program C on microcontrollers is that that isn't how it's going to be.Quoteprint and println class methods, actually (so "Serial.print(...)" rather than just "print(...)")(writeln is Pascal...)

author: Kremmen
author_rank: Super Contributor
timestamp: October 21, 2012, 07:10:58 am
content: Quote from: westfw on October 21, 2012, 02:32:02 amAnd so it is of courseI'm confusing Arduino and Delphi Pascal here, i see. Been doing Delphi in the past and still consider that a gentleman's environment, however out of the picture it may be in these Java days.Otherwise your post reflects my thoughts precisely.