Is the learning curve really this archaic?

Hello, I am building a project that I don't really know how to build, but more specifically, don't know how to code for. I have asked these types of questions before, but I feel rerwording it may help me get to a better understanding.

I once taught myself to play guitar in a setting where I had access to other people that also play the guitar. In that process I would tear through every musical theory book I could get my hands on. With that said, I have definitely learned much more than I needed to learn to play the way and style I wanted to play. In the end, I was able to outline specific parts in theory that if I solely focused on, would have learned to play knowledgeably much sooner had the learning curve been better streamlined. In the process I even developed a scale board that can teach anyone how to build a chord anywhere on the neck without you first having very specific knowledge, and over time, through reverse engineering, you could further your own studies and learn music while actually enjoying it as you go.

So, here I am, knowing very little code, wanting to once again learn first that which would specifically fall inline with this project I am learning to build. I was in search of code generators, but apparently they only exist in theory. I am wanting to have a sketch completely designed for me for free of course. I can then analyze this sketch word by word, character by character and learn why it is written the way it was, to achieve a viewable result (my project in function). To have such an ability, I feel would greatly streamline my learning curve and teach me coding concepts that have real world usage right before my eyes.

So please tell me I can skip reading and fully comprehending the entire "Reference" page before I begin coding? Also, I am well aware of the many example sketches that come with the IDE, but turning an LED on, then off is not what brought me to Arduino, desire to build my specific project is. To be able to build all or any specific part of my project will make it that much easier for me to learn, and correct me if I'm wrong, but learning code can begin with any code, or from anywhere on the reference page? Or do I literally need to learn the bare minimum sketch, fully comprehend why it is the way it is, than move onto the next example?

If you could go back and teach your younger self how to learn coding, would you really make your younger self reread all that you've read knowing that you didn't need to read it? Well here I am, your younger self.

I am wanting to have a sketch completely designed for me for free of course.

You never got around to saying exactly what that sketch is. Your statement: "...for free of course" is about the second best example of chutzpah I've ever seen. (The first being the Menendez brothers pleading for the court's mercy because they were orphans.) Also, your assumption that your time is worth more than ours seems a bit arrogant to me.

I'd suggest that you do what most of us have done. Study the language. If you have a specific project in mind, Google it. Chances are someone else has already grappled with it.

Finally, this is a help Forum, not a do-it-for-me-free Forum. You'll get more help here if you leave that chip on your shoulder at the door, enter with hat in hand, state your problem, and kindly ask for our help. We'll decide if and what the nature of any forthcoming help will be.

I play the guitar myself. When I first started to learn, I really wanted to be able to play this song called "Classical Gas". It isn't really that hard now that I play well, but to a beginner it was Mount Everest.

But I couldn't just start straight out on that song could I? Nope, had to learn a bunch of boring stuff to get there. And of course when you get to the other side you see tons of ways you think you could have learned it faster, that's what learning is.

If I could go back and teach my younger self to code? My younger self did code. So I don't know how to help you there. I guess my advise would be that there are two very distinct sides to coding. There's the language and the logic. Too many people get too focused on the language. You gotta know it, but the logic is the part you gotta learn. Languages are easy after that.

There are basic concepts to coding. Ideas about how to write a specific set of instructions that you can follow one at a time to get to a given end point. If you can't write your program in plain english (or whatever language you speak) where anyone could understand it then you have no hope of writing code for it.

Once you understand the logic, then the different languages are a piece of cake. You can always look up syntax on the internet. All languages have the same basic constructs, if - then - else, while, for loops, a way to store and retrieve variables, and stuff like that. But before you learn the syntax to go with any one language, you should learn how those basic constructs go together to make a program.

I guess another way to say what I'm trying to say is, you have to learn to think like a computer and not a human.

I learned to play the guitar when I was a kid, having heard Jose Felicianos version of "Light my fire" I practiced every day until my fingers were bleeding (litterally). I finally mastered that track by finding every single note just by trial and error but decided the pain just wasn't worth it, so have stuck to keyboards ever since.

Unfortunately you can't very easily learn programming like that. Just as, being able to play "Light my fire" note perfectly, doesn't make me a guitarist, likewise, learning to copy a program won't teach you to become a programmer.

Sooner or later you'll need to get to know the syntax, structures and, at least, most of the keywords of the language.

Econjack, you completely misread me. I am not seeking a member to write my code for me, but a program to generate a working sketch based on the criteria that I create.

Delta_G, that was the best explanation I've gotten on this topic thus far. I suppose I should take what you said and run with it and plot out my sketch in common English, then see about translating it into the language I am yet to learn. I now see I need to focus on the verbs and not the nouns. This is also easier for me to grasp.

Sorry if my original post was not worded carefully enough, but thanks to you both for the replies.

Hey Ken, thanks for sharing. I am not wanting to skip out on learning any of this, just want to focus on what’s mostly applicable and was wondering if there is a functional code generator that would allow me to program my channels, variables, inputs and outputs, then it kick out a sketch that works, and I can use it on my project all while studying it in great detail to begin my learning based upon something that I actually care about.

Traditional music teaching concepts teach the student some techniques, but by the time the syllabus eventually begins to cover the type of music the student actually enjoys, the student would have likely dropped out of the class and moved onto the next whim. My point is that I see no clear outline for learning what I perceive to be an extensively broad subject matter and I was hoping there could be a more streamlined way to digest it. For me, this would be in the form of building a project that I actually want to build. This would give me some pride and joy. Committing to forcing myself to read through page after page of randomized reference material, page after page of randomized syntax and page after page of chasing erroneous leads regarding a project that was showing signs of being similar to mine, but the nuancial differences would make my project so much more different.

I am not trying to come off as cocky or lazy. Well you can kind of nail lazy on me because I don’t want to wade through topics that will not immediately involve my project. I’m sure there will be plenty of “future” time to learn subject matter that is related in nature, but not specifically applicable.

I am wanting to have a sketch completely designed for me for free of course.

Is this question in any way related to: http://forum.arduino.cc/index.php?topic=296105

What, are all the trolls bored?

KenF: Sooner or later you'll need to get to know the syntax, structures and, at least, most of the keywords of the language.

And you'll eventually learn what a "switch" is.

[quote author=Nick Gammon link=msg=2065368 date=1422518870] And you'll eventually learn what a "switch" is. [/quote]It's that thing that goes with a case, isn't it?

was wondering if there is a functional code generator that would allow me to program my channels, variables, inputs and outputs, then it kick out a sketch that works

If such a thing existed, I can absolutely guarantee you that learning how to use it will be a vertiginous learning curve compared to any sketch you're going to write for an Arduino.

Have you looked at the Thread planning and implementing a program ?

It is a moderately complex program constructed from several simple functions so that it should provide a reasonable template for many other projects.

Experienced programmers always see a project as a series of small pieces - not a whole elephant to be eaten in one bite. Makke separate small programs to try out the different elements of your project. Don't try to combine them until you fully understand the parts.

Arduino is a great system for learning-by-doing. The Arduino IDE comes with a huge number of examples that illustrate most of the techniques you are likely to need

Just jump into the shallow end of the pool and have fun ...

...R

Learning to play a musical instrument is a useful analogy to learning to program; it's hard and you'll have to work at it if you want to master it.

But, as KenF points out, you can fake it if your desired endgame is to build a single project/play one tune - there are many examples on the forum of people taking code found on-line that they don't understand and tweaking it by trial and error and some help from forum members into something that works. An important question though is whether you're interested in leaning to code or whether it's a necessary hurdle to overcome to build your project.

If you can split your project into small subtasks, you can use them as learning exercises that makes progress towards getting it done while picking up some coding skills on the way.

On the how would I propose learning front, I'd suggest that the process will be a lot smoother if you have the patience to do some pre-work. Do some C or C++ tutorials - just enough that you know how to use if, for, while, switch. Functions and arrays would be nice too, but that can wait a bit if you're in a hurry.

Then work through some of the IDE examples; you may not find blinking an LED very useful, but just seeing concrete examples of the constructs you saw in whatever tutorials you found will cement that knowledge. Also, it'll illustrate the use of setup & loop rather than the main function that you saw in the tutorials. Get yourself a copy of the Arduino Cookbook - loads of code to read in there and useful examples that'll likely find a place in your project.

Then learn by doing. Try to code small parts of your project or just experiment controlling the hardware you've bought and ask advice here when you get stuck. You should make good progress in a few weeks, which is more than you can say of your experience learning the guitar I suspect.

Delta_G: . . . you have to learn to think like a computer and not a human.

^This

Thanks everyone (and trolls). To be honest, it is purely the desire to build and code my project that has brought me to arduino and coding. I don't mean to imply that my time is somehow more valuable than yours or anyone else's, but to me my time is important, and also to me, your time is important. If it were up to me, you would have learned coding the way Neo learned Kung Fu, instantaneously. Because it has taken you umteen years/months to code, are you then of the belief that everyone else after you should also have to invest at least that amount of time? Would you prefer that people after you invest less time, that they have more time to live life and enjoy other things?

I assume the best of all people, so I also assumed you might be interested in helping others is less time.

I will take wildbill's comment and also Ken's comment and begin there. I will delve into some C/C+ tutorials and learn the verbs, and when and how they are used and branch out from there. I already have taken the time to generally learn arrays at the suggestion of another member in another thread. Maybe I needed to know arrays, maybe not, time will only reveal to me whether that be true. If at the end I discover that I won't need arrays, I will then have misused that amount of time learning something that is very important from the coding aspect, but would have been a waste of time in terms of what I need to learn for my project.

As with all other things I l have learned freely on the web, if at all possible, I will try to streamline when giving what I learned to someone else. This is how the human race is able to advance, by making it easier for the next man. Lest we still need to chisel out stone wheels, but we first must wait for someone to invent the chisel.

Thank you for your time!!!

myggle: Because it has taken you umteen years/months to code, are you then of the belief that everyone else after you should also have to invest at least that amount of time?

No. That is why I posted Reply #9. Maybe you missed it.

...R

I strongly recommend that you stop looking for a silver bullet that will let you avoid having to learn a little coding. There is undoubtedly a yet to be invented teaching method that will make it easier, but when you consider how long people have been learning to program, it’s unlikely to come along in time to help you out.

Be happy that you have the massive advantage of the internet to help you, unlike those poor underprivileged souls such as myself who learned their skills in the seventies.

I’d also caution you against trying to tailor your learning to the bare minimum needed to build your project. Just knowing that arrays are available is helpful and the same with other constructs. You’ll find it useful to know they’re there, even if that knowledge only serves to make a decision not to use them.

The amount you’ll have to learn to do arduino projects is not large and any system you build is highly unlikely to be particularly complex - you won’t have enough flash or RAM to make such a thing.

In short, just get on with it; learn the basics as I suggested and write some code. It’s not a thing that’ll take months - write a bunch of little sketches and you’ll see your understanding improving in days.

Perhaps a blocker for you is that your ultimate project has quite a lot of stuff in it and you can’t see how to get started. Once you can code at all, take Robin’s advice and eat that elephant one bite at a time.

So please tell me I can skip reading and fully comprehending the entire "Reference" page before I begin coding?

Yes, of course. A reference is not intended to be read through (a tutorial probably is, however).

You will not find a "code generator" that can output code for your project (which I don't think you have given any glimmer as to what it is). There are so many things it could be: lights, inputs, outputs, motors, sensors, storing things, retrieving things, etc. that such a code generator would be almost impossible to write.

I suggest you break the project down into component parts, for example, do you need user input? From a switch? Then get that part working. Do you need output? To a motor? Then get that part working as well. Do you need to know the time? Read a tutorial on installing clock chips.

You can build up gradually, and learn what is required, and ignore the things are not required.

wildbill: Perhaps a blocker for you is that your ultimate project has quite a lot of stuff in it and you can't see how to get started. Once you can code at all, take Robin's advice and eat that elephant one bite at a time.

And remember, we are here to help with any ... more specific ... questions you may have. Get started, get stuck (real stuck, not 1 try and give up stuck), then come back and we will see what we can help you with.

Robin, I have read your lengthy thread regarding doing multiple things at once at least twice and at the time of those readings, I knew it was going to apply to my project, but was still a bit ahead of my studies if that makes any sense. So I will be revisiting that in short time. Right now, I want to focus on gaining general insights into the various constructs that wildbill has pointed out. ' wildbill, you hit the nail on the head with your opening paragraph (#14) of acknowledging that a teaching method is yet to be invented. That really sucks for me, but it is what it is. So I have to wade through all the shit like everyone else, but thank God I don't have to learn coding via 70s methods as I think that would be more difficult than it is now.

Here is the basic outline of my project that will take me better than a year just to buy and put together.

-----------------------------------AC power needs---------------------------------- 4 - 600watt HPS lights (5 A/120VAC each)---(timed 12/12) 1 - 400watt MH light (3.3A/120VAC)---(timed 18/6) 2 - 95watt inline duct fans (o.9A/110VAC each)---(440 CFM, speed controlled) 2 - inline booster fans (0.75A/120VAC each)---(180 CFM, DHT22 controls these)

7 - 8watt water pumps (0.06A/120VAC each)---(triggered once daily to feed plants)

-----------------------------------DC power needs------------------------------------------------------ 7 - 12VDC Plastic Solenoid Valves (n.c.) (triggered to empty spent nutrient reservoirs into master waste line) 8 - 6VDC peristaltic dosing pumps (to mete nutrient into water lines User/probe value controlled) 7 - PH Probes (collects acid/base data and dictates functions of peri pumps) 7 - EC Probes (collects electical continuity data and translates EC to TDS in PPM) 7 - DO Probes (collects dissolved O2 data) 7 - water level Probes (collects consumption data) 7 - water temp Probes (collects water temp data) 5 - DHT22 temp/RH sensors (dictates alarm and other functions from AC fans) 5 - CO2 sensors (dictates room air exchange) 5 - photo sensors (detects light leaks) 3 - Odor sensors (also dictates room air exchange)

I know Billie's Hydroponics Controller has already achieved a lot of what I'm trying to do and for the most part will be the boiler plate that I base my project off of. My project however will not use an LCD, and it will monitor and control several reservoirs of varying nutrient mixtures. This is the extensive overview.

Right now, I just want to focus on controlling an 8 channel relay board and 2 DHT22 temp/humidity sensors over an Ethernet network. The sensors will be assigned to On/Off one or two relay channels, the other 4 channels will need to cycle in accordance with a DS1307 RTC, and the final 2 channels will likely just cycle when prompted by either a physical button, or a digital button on my phone. As the Arduino Commander app is too limited, I will need to find a better working app or write up a code that can function within the above parameters.

I know just the first phase of my project will likely take me months to learn to code for, but if at all possible, I was hoping to first learn that which is most applicable so I can have a working demo up and running ASAP. Then I would be able to learn as needed to further extend my project. I fully comprehend that this will likely involve many arduinos as slaves, and the volume of code will likely max out each arduino. I am prepared to make whatever compromises I need to, to get this project off the ground. I am just trying to limit the amount of time I will need to invest to build my project because my passion in life is not Arduino or coding, that is just a means to serve my passion of gardening. My project, when complete will afford me more freedom to enjoy life as I'm currently nailed down to my garden and would like the ability to go on a vacation, all while still working my garden via internet connectivity.

The problem with not reading the reference if you are unfamiliar with other languages is that you will have no idea what might be available in the tool box, and so you will always use the hammer.

myggle: I am just trying to limit the amount of time I will need to invest to build my project because my passion in life is not Arduino or coding, that is just a means to serve my passion of gardening.

I love looking at gardens but I much prefer to do programming.

My sense is that what you want to do is too complex for your level of interest in programming and all of the electronics that will necessarily be part of your project. And I hope you see that I am not saying that the project is beyond your capabilities if you had the necessary commitment.

At this stage you are concerned about how long it will take to learn to program. But once you know how to program you will probably find (as I do) that 60% to 80% of your time is taken up with debugging and that is almost a separate skill that is, unfortunately, acquired with experience. It is not unknown to waste half a day because I have a comma in the wrong place and don't spot it. Or waste half a day learning and trying out some new technique that proves to be inappropriate.

Over very many years of dabbling with programs (I have never been a professional) I have subconsciously acquired a wide range of concepts that pop into mind when presented with a problem. I think that acquiring the vocabulary for a language is the nearest equivalent concept. It is different from learning a skill.

I am tempted to ask whether you would learn to weld so you could make some garden furniture, or whether you would get an expert to do it to your design. But, by comparison with programming, welding is very simple, so it is not a good analogy, Maybe a better one would be learning to sculpt stone to make a garden statue.

...R