Any more user friendly way to program sketches?

This might sound like a very wimpy question, but I'm a total newbie to c++ programming, and I have been absolutely struggling, with about 10-20 hours of research/tinkering to get the most simple piece of code to work right, and its still not working. Which by the way, if anyone wants to help, I have a thread here http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1295303511/0#3 . Anyways.....

All these different commands that have to have the absolute perfect syntax or else you'll get a cryptic error that usually won't make sense. You know what you want to do, but if your missing one little bracket, or space, or symbol that your not aware of and it won't work, and you spend hours searching the net trying to figure out just the right syntax.

I wish there was a easier GUI. Similar to those HTML programs that let people design websites without specifically knowing HTML. It would be nice if you could use buttons or dropdown menus to do stuff in plain english like "When pin3 is high, output to pin 8", and then have the software do all the proper coding for you. Or say you want to do switch case statements, it would be nice to just have a "add switch case statement" type form where you just fill out the boxes with the various variables and results, and let the software handle all the colons, brackets, spaces, syntax, etc. Does any sort of c++ editor like that exist that is arduino compatible?

Once you learn code (which is really not that hard), It will seem far easier and less clunky then menus.

I'm having the same trouble picking up the code and syntax too.. I frustrated myself for 3 hours last night trying to write what should've been a simple program. but the words and syntax has mistified me 100 fold, now I'm no brain, but I'm not as dumb as a post either. what help can I get? >:( :cry: :o

Just google C programming tutorial.
That and read this:
http://www.earthshineelectronics.com/files/ASKManualRev4.pdf

ASKManual stands out to Arduino Starter Kit Manual, its from here:
http://www.earthshineelectronics.com/10-arduino-duemilanove-compatible-starter-kit.html

what help can I get?

I think different learning methods work for different people. What I've found helpful for me is to just load an example sketch from the IDEs files menu. Then just start reading the statements line by line. If you completely understand the line, move on, if not go to the Arduino reference page and read about the statement or function until you do have a feel for it. Try harder and harder examples.

Reading other peoples code helps me a lot in my learning. But as I said different strokes for different folks.

Lefty

I have been learning bit by bit, but its just all the annoying things like certain things not working and you cant figure out why, and eventually it turns out to be some stupid thing like certain commands/symbols need spaces between and others don't, or things like empty brackets, or tiers of brackets and one command is on the wrong side of one. Some that need brackets and some that don't, or you forget to capitalize a letter and it doesn't work, or stupid things like that.

And most of the time the error messages make no sense, etc. I wish you could type stuff out in a more straightforward, english manner, and let the program decide what sort of empty brackets, tiers, goofy punctuation, etc. goes where.

I hear you and I hear that from others at times. However there is no simple method, if you wish to write your own arduino sketches you have to learn to program in the standard C/C++ language. There are other micro platforms that use somewhat easier to start programing like the Picaxe system is similar to the arduino system but uses a BASIC type programing language that some find easier to start with.

http://www.rev-ed.co.uk/picaxe/

I've tried both, both are useful. I like hardware more then software, but I'm glad I moved on to the Arduino and progress has been slow but steady. Having fun is what it should be all about, so if your not having fun, try something else. Life is too short as is.

Lefty

I think one of the problems here is that many people come to the Arduino platform with a specifik project already in their head.

So they start to build / code their project, trying to learn both electronics / hardware and programming the Arduino at the same time.

It would be much better for people at the "entry level" if they first cleared their minds of their projects and started with the basic tutorials, like make a LED blink etc. and then gradually move up to more complex projects, starting to think about what part from each project could be used in the context of their original project.

It's a matter of learning to crawl before attempting to run a marathon.

Arduino has taken a lot of the complexities away from using microprocessors, but there really is no easy way to learn programming and electronics, and that is especially true for C(++). It's like asking how to get 5 years experience in a week, it's not likely to happen within any field.

When that is said, i think the errormessages from the compiler can be confusing even for experienced programmers. I spend my share of hours looking baffeled and pulling hair. But when you get some experience you will quickly find the most common errors, like missing curly braces, semicolons, case sensitivity errors, and using the wrong datatypes.

One solution would be to stop using C and use a more understandable language as the front-end (which for all I care can either generate C as a later stage and then proceed in the current way, or directly compile to AVR binary in some invisible manner that I don't really need to be involved with).

Unfortunately, the situation on the Arduino presently is very incomplete when it comes to language choice. I've looked at using Ruby, but the way of doing that is so badly documented that nothing works (a technique called “RAD”). I've looked at Forth, using Amforth, which is not only extremely technical and complicated to actually get onto an arduino, but when you do, it is always so incomplete that it requires too much work to even be able to write a 'hello world' blink word. However, it doesn't seem to work the way it should, producing spurious errors for no good reason. I took a brief look at an odd language called Plumbing, or Concurrency or something (they seem undecided as to what its name is, referring to it by about five different names). Following the instruction pdf, no progress can be made beyond page 14 because it simply fails to work before the 'hello world' blink program can be implemented.

One thing is definite. I will not touch C — I hate it. I've spent the past few months reading through Kernighan and Ritchie — boring, technical, obtuse, illogical, unfriendly, complex, tedious and above all, sleep-inducing. I've got as far as chapter 3, and at this rate, should be finished by 2012. Now that I understand C a lot more than I ever did, I can honestly say it is a fundamentally badly designed language, fit only for historical interest, and should be abandoned forthwith. It is wrong.

You were invited to join the mailing list and ask for help, Ian. You didn't. Your problems were almost certainly user error.

Please feel to join our list and we'll be glad to help you.

Now that I understand C a lot more than I ever did, I can honestly say it is a fundamentally badly designed language, fit only for historical interest, and should be abandoned forthwith.

Of course that's why it's the most common language in the world now, for creating computer programs. Must be everyone else that doesn't get it.

Ian,
C was designed as a high-level assembler to aid porting, meant to be close to the machine.
It was never intended for the casual programmer - it would be like handing a loaded gun with the safety off to a toddler.
If there were a sensible cheap alternative, I'm sure it would have been offered for the Arduino.
I've programmed enough different architectures in more than enough assembly languages to know that I'm onto a good thing, and I don't want to go back.

If you want a readable book on C, skip K&R and look at Kelley and Pohl's A Book on C.
Don't ever read Stroupstrup (well, not the first edition anyway)

[edit]FWIW, English is a pretty crappily designed language, and if it weren't for the Yanks adopting it, I'm pretty sure we'd all be speaking French (who, after all, invented everything) or Mandarin. FORTH is good only for those who speak reverse Polish. Or double Dutch. [/edit]

Don't ever read Stroupstrup (well, not the first edition anyway)

Bjarne Stroustrup

I heard his name referred to and/or pronounced as Barney Shoe strap over on the /. site. ;D

Lefty

I think my biggest frustration is inconsistencies, especially with the data out there. There is definetly a lot of good tutorials out there, lots of good examples, lots of good learning.......but only for some of the functions.

I've been finding myself getting stuck for hours upon hours on something like one single line of code. Search for hours trying to find the documentation, trying to figure out how to make it work, even just trying stuff at random, and just not being able to get past that one little line of code and move on.

I will know the name of the function I need to use, and know what I want it to do, and should be able to type it out in seconds, but instead it will take an hour just to figure out the "correct" way to type the thing you already know, like if it needs a space here, or an extra set of brackets here, or needs an ' ', or some other silly little symbol that makes what should have been a 5 second to write code, become an 1 hour to write code.

Perhaps what you need to do is understand WHY the syntax is like it is. Next time you have such a problem, post the code that is giving you problems, and we can explain what you need to do. The more of the WHY you understand, the easier the HOW part of coding comes.

I wish you could type stuff out in a more straightforward, english manner

Two examples that I can think of, that, while far from being "failures" in the marketplace, neither really made things any simpler (and some would argue they made things more complex, not less):

  • COBOL
  • SQL

Another option to simplification of coding has been so-called "graphical" programming languages, such as LabVIEW. These have their own issues, most notably when you have to create complex structures that require code modules to work, and are ultimately a major bear to maintain over time.

Note that I'm not saying that C/C++ is the best language; far from it: I believe that we have a long way to go in the development of programming languages...

:wink:

You forgot IBM's attempt - PL/1, or 'when Algol metCOBOL'

carl1864, - have a look at this: Data and the Forth Stack

It's the online version of a book called Starting Forth. Easily the best book on computer programming I've ever read (wish I still had my original copy). It is my opinion that Forth should be the default language for arduino (which of course won't stop C from still being available for those that fail to see that C is too difficult).

It's so understandable, and by comparison, everything to do with C is so incomprehensible.

I've basically put away my arduinos for this year until I find an easy way of using Forth on them. We definitely need a Forth for arduino for the normal user. That's the way forward.

We definitely need a Forth for arduino for the normal user. That's the way forward.

Because RPN is so...intuitive.

If I had to choose between Forth and assembler, I'm pretty sure I would go with assembler (but that's a biased observation, YMMV).

:wink:

I've likened learning to program to learning French - some people take a few classes, get as far as singing 'Sur le pont d'Avignon' and then pick up 'A la recherche du temps perdu' and wonder why they trip up on the first paragraph.
Actually, programming makes things worse by providing libraries, which are a bit like phrase-books, where you can use the language without understanding the principles - great for ordering a beer and croque monsieur, but useless for translating the Gettysburg Address (BT,DT).

Take the time to learn the basics; at least C doesn't have gender and irregular verbs!