Arduino Forum

Using Arduino => Introductory Tutorials => Topic started by: lastchancename on Sep 02, 2017, 04:18 am

Title: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Sep 02, 2017, 04:18 am
Many learners come here with post #1, asking 'please write my robot, quadcopter, RC car code for me'...
Perhaps I'm a bit mean... and you really did try to import your working Visual Basic code straight into the Arduino IDE...

This ain't going to happen.
The best outcome may be that you're referred to an existing thread that will point you in the right direction, or a really generous soul may take you offline to hold your hand with their experience.

The best way to get meaningful collective help - is to make an attempt at understanding your own problem, and the tools at your disposal.     If you have trouble - ask questions on each of those - not the complete end project - yet.   Remember to include your code within the </> code tags

After you get the basic wheels turning, make a first attempt at coding the pieces of your goal - not all in one (that will never work for a newbie).  No-one will laugh at you for trying, but always comment and name your elements so the teachers can help!
Compile and run each piece so you understand and can optimize / comment it as you progress and understand the code.
If you have trouble - ask questions on each of those - not the end project - yet.

Stitch the various pieces together (adding & testing one at a time) to get them working as you expect.
If you have trouble - ask questions on each of those - not the end project - yet.

When you have all the pieces tied together - they may work, or may need some review and fine tuning.
Post a complete explanation of what you expect the sketch to do, along with what it does wrong, and any error messages from the compiler.

If you don't like the answers you get - perhaps the problem isn't in the answers.
Maybe you need to revisit the question, or accept the help is being given by unpaid people that want to help those that help themselves.

Remember Robin2's guidelines -
Planning and Implementing a Program (http://forum.arduino.cc/index.php?topic=261445.0)
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: dougp on Sep 02, 2017, 05:39 am
Stitch the various pieces together (adding & testing one at a time) to get them working as you expect.
And when you add a new piece, test the WHOLE thing. Some innocent looking bit of code that functions perfectly can have an unwanted effect in a seemingly totally unrelated part of the program once it's integrated into the whole. Better to find the problem now than go four more steps and let the mystery deepen. Don't ask me how I know this.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Robin2 on Sep 02, 2017, 10:15 am
make a first attempt at coding the pieces of your goal - not all in one (that will never work for a newbie).
That might be interpreted to mean that the only reason he cannot do the whole project in one go is his newbieness. But the reality is that an experienced programmer would not try to do it all in one in the first place.

...R
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Sep 02, 2017, 01:40 pm
True, except some experienced programmers have adequate skills to 'throw' a simple sketch together, and it will compile on the first attempt - then run as expected soon after.
Beginners will rarely have this luxury, which we take almost for granted.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Robin2 on Sep 02, 2017, 03:32 pm
While recognizing the truth of Reply #3 I was trying (in Reply #2) to get across to a newbie the idea that he should not be critical with himself when he is unable to write a complex program all in one go.

IMHO the key skill that experience builds is the ability to perceive quickly how a project should be implemented - because he can "see" how various familiar small elements can be used together to do something new.

...R
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Dec 15, 2017, 09:35 am
The rare case for me is when the person needing help has done a lot on the project and is not going to learn the code part for good enough reasons.

I'm talking about working apps like chicken coop or hydroponic automation, not toys or school work. These people do enough putting the rest together and when it's done the project may do some actual good.... yeah, I'd like to help.

As for helping students too much, the harm from that comes in many ways and not just to the cheater who will not learn enough to get through the next course (will try to cheat on that too) and lower the grades of honest students competing in that course. If the cheat can graduate and get a job in the field, they will show themselves incompetent but with money/connections or government programs might get a management position where they can do real damage -- as I have seen before.

We also get enterpreneurs occasionally looking for free work or ideas.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GreyArea on Jan 05, 2018, 10:32 am
To all you old lags...sorry, experts :-)...

I get it...most of you probably have your own projects or even businesses and can't b3 held responsible for this kind of workload. Also, newbie requests by their very nature don't give enough info...or even wrong info...so you'd spend a lot of time writing only to be told "Ah, that's not what I really wanted..."

However...

As a newbie myself, I'm happy to share bits of code that I've got working. Ugly though they may be to your experienced eyes, it helps me to learn and hopefully helps the other person asking.

I realise that's not the same as writing code for someone with a good expectation that it will be full functional, but I wanted to reassure other newbies that help will be forthcoming from this forum (trust me, it is!).

The problem with being a newbie is that even with stickies that instruct us to include all the important information, sometimes we don't...because we don5 know what's important, because we're new!

On the other hand, forums of all sorts should welcome them; in my experience it is the newbies who bring new ideas and challenge the experts to think in new ways.

So my advice...to the newbies...be polite, accept that you know very little and help the experts to help you by giving as much info as you can.

To the experts...try not to jump to "It can't be done" by your second post - or at least, back it up with "...but you could try this instead..." - and please, if you must refer a newbie to a sticky, at least say "hi" or "you might want to read this" in the post; an unannotated hyperlink comes across as very dismissive...

Thanks to experts and newbies alike for the help I have received...
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: ballscrewbob on Jan 05, 2018, 09:53 pm
@ Grey Area

let me take your post at face value for a moment.

Old lag works for me right out of the box.
Expert I don't think I am nor could I hope to be.

I hack and slash for code and have shared in the past so nothing new there.

This next bit I do take issue with. Please read this post (https://forum.arduino.cc/index.php?topic=148850.0) and tell me it does not contain the correct instructions to a noob such as you or I on what to include to get the best help and if you have any good suggestions I will steal them as I have a similar one in CREATE.

I think all noobs are welcome as is often seen by other people having to answer the same type of question from a noob almost on a daily basis. Never seen anything like an "OMG not that again" although plenty of "please read this first" (as they should)
If its something I am sure they could have found by even the simplest of searches my answer can on occasion reflect that and hopefully make them think for themselves a little.
Having like many done the "please read this first" only to have to follow up again and again in the same thread only to get to a point that could have been answered if they "HAD READ" the "please read this" in the first place then peoples patience is often pushed to the limit and I can assure you there have been some I would have gladly spoken to in much stronger terms for wasting so much time.

Again many experts will gladly take constructive criticism for being wrong from what I have seen as nobody can be perfect.
Many of the regulars you see answering questions do so because they can. They don't have to be here and don't need to help as much as they do but chances are if they say it wont work they often do give a reason why.  Almost everything you just said has been said before a load of times. Dang it I probably said some of it myself ?

Its nice to get the thanks for anyone but you only need to read many of the posts to see that somebody may get an answer and the person who gave it never knows if it was right or wrong as the OP never gives any feedback. In many of those cases only the person who answered will often know if they gave the best answer or if it was likely to fix an issue...



Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 05, 2018, 10:44 pm
I realise that's not the same as writing code for someone with a good expectation that it will be full functional, but I wanted to reassure other newbies that help will be forthcoming from this forum (trust me, it is!).
I learned beginner into experienced coding by reading, writing and fixing it and sometimes even took a course or two in the 70's and 80's.

I worked for my skill even when getting help which was harder pre-internet. I was grateful for any help, tips, techniques, etc, I picked up.

There are things that I could have done to make my way easier, saved me the years of spaghetti-coding I did and I will pass those on to others as best I can. Yeah, I'm a lag....
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: larryd on Jan 05, 2018, 11:47 pm
old lag meaning, definition, what is old lag: someone who has been in prison many time...

I have written complete sketches for new people only after considering their motivation.
Even so, I do this when I have some similar code already that needs minor changes, or when I have a similar interest in writing the sketch.
On several occasions, beginners (to the forum) are quite appreciative, on many occasions, not a thank you.
Of interest, when you try to quiz the OP on a finished sketch, the OP goes MIA never to be heard from again.


We all do this as volunteers and do get something out in helping others.

Beginners must realize we have seen and heard it all.
If you put effort in, you will get effort back.

Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Grumpy_Mike on Jan 06, 2018, 11:03 am
To the experts...try not to jump to "It can't be done" by your second post
I think that comment is aimed at me, from this thread http://forum.arduino.cc/index.php?topic=517581.0 (http://forum.arduino.cc/index.php?topic=517581.0). You will notice it was reply #5 when I offered this advice, but yes it was my second post, I did read the others so I think it is unfair to accuse me of "jumping in".

I also think you will admit I was right, what you were asking could not be done. In my first post I had provided you with the evidence from a commercial device.

Quote
or at least, back it up with "...but you could try this instead..."
That is not always possible because we are not mind readers and we don't know what aspect of the project is a deal breaker. We do not know what sort of compromises you are willing to make and what is an acceptable level of functionality. All we have to go off is what you state you want your project to do.

The current culture seems to be "if you can imagine it, it can be done, so tell me how", sadly this is not always the case, as you found. However, in this thread someone suggested a compromise and did a lot of work on it for you. Note he was not doing what you asked for, that is not using capacitave sensing, but another technique altogether, which late on in the thread you eventually understood. It also had the limitations that you could not see through the tube and that was a deal breaker for you.

One of the compromises you seem to have made is to drop the curved pole requirement, and your video seemed to suggest you were happy with the results you got which bore little relationship to what you asked in the first place.

So by any definition what you were asking for could not be done and by post #48 I hope you understood what was going on.

Now I have spent all my life ( so far ) making stuff and have quite a good idea of what is doable and what is not and their are several levels of doable:-
1) Yes that is straightforward

2) Yes it can be done but not at your current level of knowledge, go learn something first

3) Just because you see a video of someone doing, something you consider similar, does not mean you can extend this because all the compromises have already been made. ( Your request for a long sensor is an example of this )

3) While it might be possible it would need a major research project and / or access to manufacturing techniques not available to an hobbyist. ( your curved pole requirement comes into that category )

4) The Arduino is not powerful enough to do this, sticking some other board or sub system to do the function and having the Arduino switch it on and off does not count as the Arduino doing this.

5) Please learn some physics because it says you can't do it.

I am sure there are several levels between these points.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 06, 2018, 11:20 am
One thing I do see from some beginners is a kind of Dunning-Krueger syndrome where code is actually easy once you know the secret password or something very similar. Learning can't be the answer, just GIVE the knowledge as the code which glanced at once will reveal ALL......

Maybe they don't believe such ridiculous crap but if not then why not learn instead of wasting everyone's time?

Learning takes effort by the teacher AND student. The student is the one that must do all the real work.

Demonstrations/examples are only good to those who can repeat them and take them farther. If all you want is to read through material and call it good then perhaps you're more cut out for humanities studies where opinion matters rather than science, math and tech where opinion decides nothing.

When beginners who complain about the help they get here start to get to know the COMPILER they finally met a real enemy. Next worse up is facing their own runtime errors! By then the beginner attitude should be gone.



ALSO I don't believe that every beginner here is a beginner. We get idea-hunters looking for free intellectual property that they can claim as their own. If you find yourself doing free engineering work where you should have stopped, stop! The only thing you're teaching is how to cheat, it's not just students playing that game.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Robin2 on Jan 06, 2018, 07:34 pm
perhaps you're more cut out for humanities studies where opinion matters rather than science, math and tech where opinion decides nothing.
What I like about programming (and engineering in general) is that I am pitting my wits against unforgiving and unbiased nature. Not against the opinions of another person.

If you don't do it right the bridge will collapse. Doesn't matter if it is within budget or if it matches the local architectural style.

...R
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 06, 2018, 08:34 pm
Yup those runtime errors can be a beee-otch!
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GreyArea on Jan 07, 2018, 02:45 pm
Well, that escalated quickly.

Mike;

1. You're not alone in the "it can't be done" by post two thing and I mean across multiple forums, not just here. But yes, the cap fits.

2. Yes, Tony Wilks (bless you sir) really got the bit between his teeth and proved that the concept (very long triangular contact plates) COULD work, even if what I called it was the wrong thing (though as you know in my defence, I just used the same term as the YouTube video I'd seen.

3. I have in no way given up on it, (I haven't dropped the curved pole requirement; just cos I posted test video with flat contacts outside doesn't mean that's the finished article) and the fact you can't see through the contacts is something I'm still working on thanks to helpful materials advice from other forums and companies (sigh, more spending...)

Mike, I like that you know your stuff, but I do think your choice of forum name indicates that you MIGHT  already have a little self-awareness of your preference for naysaying!
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 08, 2018, 02:57 pm
When Mike writes

5) Please learn some physics because it says you can't do it.

the proper response is to engage as to why unless you've already danced around that point. AFAIK you two argued about different things that seemed to have morphed along the bent or straight tube way but here now he has made a definite unequivocal statement.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 08, 2018, 03:37 pm
Back On Topic?

When I give code I try to get people started with a sketch that can be greatly modified, do more in an easier cleaner way by following how the sketch as given works.

The examples use tasks, sections of code inside of loop() that are not inside of each other but do share data and control info through variables. To add to the sketch you only need to add a task and whatever variables if any are needed, maybe change an existing task to trigger the new one -- without having to weave it into a block of nested if-else type structured code that grows with every change into the dreaded spaghetti-code; the bigger the bowl, the more tangled it gets.

With tasks you can keep the pieces small and indentation levels low and more of your hair in the long run. So I try to introduce that and so do most of the old lags on this forum in the form of "do many things at the same time".

This is a different way to code than the standard. This is how automation has been coded for decades, I didn't invent it, I learned, how about you?
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GreyArea on Jan 08, 2018, 04:41 pm
When Mike writes

5) Please learn some physics because it says you can't do it.

the proper response is to engage as to why unless you've already danced around that point. AFAIK you two argued about different things that seemed to have morphed along the bent or straight tube way but here now he has made a definite unequivocal statement.
Argh, I was going to let it drop. Last post even if there's a reply, promise.

Mike's list of six points (1, 2, 3, 3 again, 4 and 5) weren't aimed at me...he said they were the "levels of possibility" he's employed over the years. I don't think physics was the issue...well, maybe, but more in terms of different environments or a missing "piece"...which I think is what Tony Wilks added in.

I'd also hope if Mike's been doing it so long that occasionally, particularly when he's used replies 3, 3(a) or 4, (even perhaps 5 if I'm right about Tony's work) someone has actually come back and surprised him.

Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Jan 15, 2018, 04:16 am
One major challenge when communicating to genuine newbies (or lazy halfwits), is when a button or link doesn't exist that says 'make my program work'.
"Can you write one for me" - not even a question.

Early posts from the truly uninitiated - clearly don't understand there are ALWAYS more than one concept at hand in any project - even blinking a single LED.
It's this fundamental idea of breaking your desire into manageable chunks that seems to escape many.

"I saw an app that does 'this' I have to do the same by tomorrow..."
Let's define - saw, app, does, this, same
It makes a difference!
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 15, 2018, 04:11 pm
I'd also hope if Mike's been doing it so long that occasionally, particularly when he's used replies 3, 3(a) or 4, (even perhaps 5 if I'm right about Tony's work) someone has actually come back and surprised him.
That happens how often at all? And how often over something other than critical details?

I will just have to find a way to live knowing that Grumpy Mike is not god perfect after all.

But if he tells you that something is not physically possible, you can bet he's got solid reasons behind it. What you should seek to attack are his reasons instead of throwing weak ad-hom innuendos to distract from having lost the point.

I have to wonder now where that thread is. IIRC there might be a link in one of the posts. If I find juicy stuff, I'll bump the thread!
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 15, 2018, 04:55 pm
It's this fundamental idea of breaking your desire into manageable chunks that seems to escape many.
For the most part, you might as well discuss the literary techniques used by Steinbeck with kids who haven't bothered learning their ABC's yet.

The others who say right out that they're not going to become coders, if I can help an honest worker then I'll try but .....

I'm not here as a free service getting enterpreneurs their product start-up code and likely the concepts behind it. If the latter set want to learn then fine but I've known too many who only lie to get you going along then try to slick you into a deal that you WILL lose by design. Don't work for promises, that is what you will get besides some pin money, to pin you in place.




Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Jan 15, 2018, 10:05 pm
Lying to get help...
That opens another completely different can of worms.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Grumpy_Mike on Jan 16, 2018, 12:08 am
I have to wonder now where that thread is.
This is the thread https://forum.arduino.cc/index.php?topic=517581.0 (https://forum.arduino.cc/index.php?topic=517581.0)
I think you will see that he has moved the goal posts a lot since my original comments. My thoughts were:-
1) He wanted a capacitive slider sensor that was a meter long. The commercial cap sensor chips do not go that long, I provided a link to one to show him.
2) The cap sensor he wanted would have to have transparent conductive coatings applied to the inside of a bent tube. A bit "ship in a bottle" given that conductive coatings are normally put on with vacuum deposition.
3) Even bending a 1 meter tube is not something that is practical for a non commercial outfit.

As you see Tony came up with a capacitivly coupled potential divider which gave the promise that it might offer a partial solution but it failed on the transparency requirement and required almost floating pins. That is it was not very reliable. In the meantime GreyArea came up with a sequence of capacitave sensor "notches" that would sometimes work if the hand was dragged from one end to the other.

None of those developments, interesting though they might be, in my mind invalidated my original low key comment that I didn't think his project was possible even if GreyArea thought it did, as mentioned in his linked video.

Most of the time an "impossible" project is made possible by changing the requirements, or making it so unreliable or poor as to be not remotely the same project. I am reminded of the person here who wanted to stream live video using an Arduino. I said it was impossible, and someone jumped in and said it was and "proved it" by showing a project where a 4 by 4 pixel image was streamed off an SD card.

I rest my case.  ;) 
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 16, 2018, 12:43 am
Oh, that thread. Yeah I read and avoided chipping in.

You know how when a magnet is in contact with ferrous metal the metal becomes part of "the magnet"? Even close, a field is induced and the strength of the field may vary in the metal.

So anyway we have linear Hall sensors that could likely measure field strength at both ends of a steel wire and determine some facts about a close-held magnet. Of course orientation of the magnet would matter and Murphy gets a say....



Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GreyArea on Jan 17, 2018, 01:03 am
Someone did suggest a Hall effect sensor but I wanted to avoid the need for a magnet or other gizmo...it's not that I want it to be magic only the magician can do, I want it to be magic ANYONE can do.

Still haven't given up, awaiting materials for more tests. Bit of miscommunication on my part...the tube is just a straight tube...I looked back and I used the word "curved" just to mean it was a curved surface, but it was a poor choice of words.

And yes...depositing the contacts on the inside of a tube would be difficult. Which is why I'm not going to do it...but there are other ways Mike...wheels within wheels ;-).

By the way, I'm not one for adhominem attacks...I never originally mentioned Mike by name and if he hadn't recognised himself and spoke up, I never would have. I don't think I've called him anything worse than he calls himself ("Grumpy") and I hope you'll see it's good natured...I have learned things from Mike, but just because I'm new here doesn't mean I have zero knowledge of everything; this isn't an area where I have much hope of success I'll admit...the main challenge would seem to be reliability...but I've learned a few tricks already that MAY produce exactly the effect I was looking for, WITH the main restriction that it not use too many pins or occupy too much volume.

And yes, in a few weeks I may be back here, tail firmly between legs with a "guess what, I couldn't get it to work" post...

But I'm allowed to TRY aren't I? I mean, isn't that what the other posts are lamenting too...the fact that people just give up or want it done for them?

That was the thrust of my post...it seems a lot is expected of us people who are new. If we get told too often that "it can't be done", then we'll lose interest. Again the failing may be ours in that we use the wrong terms and not a lot of vocabulary to explain what we THINK we want; I was just politely suggesting that experts might tease out of us what we ACTUALLY want using some of their knowledge.

And patience...which if nothing else Mike has proved he has in bucketloads.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Robin2 on Jan 17, 2018, 10:11 am
This Thread is no longer a Tutorial.

I reckon it should be moved to Project Guidance so as not to confuse newbies looking for tutorials.

...R
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Grumpy_Mike on Jan 17, 2018, 10:36 am
Well I think part of this should be hived off into the communities web site section as it involves more of a how we respond to questions than an actual project.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 18, 2018, 06:45 am
I'd also hope if Mike's been doing it so long that occasionally, particularly when he's used replies 3, 3(a) or 4, (even perhaps 5 if I'm right about Tony's work) someone has actually come back and surprised him.

A "not always right but won't say how much or what, just the loaded word surprised" innuendo is attacking the person rather than what he posted even if it is in a weak manner like the use of faint praise.

THAT is what I referred to.

Since then you duck and dodge like a pro.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GreyArea on Jan 18, 2018, 10:05 am
*sigh*
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Jerryphan on Jan 19, 2018, 11:11 am
I think experienced programmers will not try to do everything in one in the first place.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 19, 2018, 07:27 pm
I think experienced programmers will not try to do everything in one in the first place.
It makes debugging a hell of a lot easier.

You're able to develop a toolkit to support Input, Processing and Output as modules ahead of time, learning each piece.

It really pays to learn or refresh at least to HS level physics to handle basic electronics and what's behind buttons and other sensors we use. OTOH just about all of this can be bought and cookbooked for those who can merge code properly, but you won't have as clear a picture without the background. Oh well, stick to whatchano and keep learninmo.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Jan 19, 2018, 10:01 pm
LOL, the word 'physics' has just hit about 30% of newbie makers between the eyes...!
You can knock out another 20% by mentioning 'computer science', and a few more with 'engineering'...

That might clean out some of the cobwebs.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GreyArea on Jan 20, 2018, 01:58 am
LOL, the word 'physics' has just hit about 30% of newbie makers between the eyes...!
You can knock out another 20% by mentioning 'computer science', and a few more with 'engineering'...

That might clean out some of the cobwebs.
Is that the aim of the experts then? To put newbies off?
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Jan 20, 2018, 02:10 am
Quote
Is that the aim of the experts then? To put newbies off?
No, on behalf of all the 'experts out there', this is simply an observation of where many/most beginners are starting from.

If a beginner doesn't have fundamental, logical concepts of physics, electricity, engineering and science - then seriously - you're making it hard on yourselves.  Repeatedly plugging a LED different ways until it works... isn't science or engineering.  It's looking for dead LEDs (and a bit of observational psychology).

Buy the training wheels, then grow into the role.  Cut & paste isn't being a software developer.  Yes, believe it or not, many devs *do* cut & paste, but it's not the architecture or critical parts of their code... and they review and optimise that pasted code later to make it more readable, relevant and efficient. 

Let's go back and reconsider that "30%..." statement again.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Robin2 on Jan 20, 2018, 10:10 am
Is that the aim of the experts then? To put newbies off?
Certainly not.

But learning, especially adult learning, is a two-way street. The student needs to put in some effort as well as the teacher. In many ways, for adult education the role of the teacher is to give the occasional nudge to the tiller to keep the boat moving in roughly the right direction.

...R
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Jan 20, 2018, 10:16 am
R2... Now you tell me!
I thought we were supposed to buy the hardware, write the code, and define the application!  In that order ;)
(I wish we were neighbours!)
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 21, 2018, 01:38 am
Cut & paste isn't being a software developer. 
If that's all you do then yeah that's right and you won't be able merge programs that step on each other.

However if you write or paste tasks into loop() and do take care over resources and labels, developing the sketch can go quickly and well.


If someone is stopped merely by seeing the word "physics" in a sentence, regardless of context then perhaps they are not suited to reading, much less writing logic. That is not to say that they can never get suited to it but that they will need become so over time to be more than clueless even with all the (entirely logical) help and docs in the world.


When I start one sentence with "It pays to" and the very next with OTOH, I do expect reasonable people with Jr. High reading skills or better to figure it out and unreasonable people to be "triggered" into their own little worlds which may be good for them; the compiler will be far harder to deal with and their own runtime errors will finish them off.

For those willing to be active in learning, simple code only takes simple understanding. What you learn raises the "simple" bar which opens up new things as simple that were previously not. Work it that way and all your steps can be "simple".
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 21, 2018, 01:40 am
R2... Now you tell me!
I thought we were supposed to buy the hardware, write the code, and define the application!  In that order ;)
(I wish we were neighbours!)
LOL!  Isn't it buy the hardware then ask others to "make it go" while you manage them?
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Jan 21, 2018, 02:15 am
Quote
LOL!  Isn't it buy the hardware then ask others to "make it go" while you manage them?
Nah, that's government outsourcing.
Private outsourcing lets someone else choose the wrong hardware.:)
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GreyArea on Jan 21, 2018, 09:32 am
Seems to be a host of unreasonable expectations on both sides.

For the newbies; yes, expecting unpaid third party effort just because you ask for it would not happen in any other field...well, maybe design, where people who should know better will often suggest that the work be done pro bono "for the exposure"...though to be fair, it's normally a newbie that's asked to provide it...

For the experts...if you think every newbie is a wannabe dev, you're asking for disappointment. Lots of people are discovering Arduino for the first time often after it's been portrayed to them as the magic box that can do anything. They get one and then realise they've done the equivalent of buying a Lotus kit car with no idea of how to put it together and don't even have a driving license. They probably should just put it back on eBay, but having made the investment, they're damn well going to give it a shot.

I don't think this thread is going to make any difference to the attitude of either newbies or experts. The experts write it in the expectation that the newbies must improve. The newbies won't read it...cos they're newbies; and when you've got one expert admitting that he doesn't read sticky posts or FAQs in his role as a newbie on other forums...you'd think some awareness of the intractable nature of the problem might appear, but it doesn't.

However...if you want to reduce numbers of ridiculous requests, then an offhand "read the stickies" comment is one way to go, but you might want to bear in mind what image that gives. Newbies talk. Are they telling their friends about the wonderful, helpful people at the Arduino forums, or are your online ears burning? I just worry you might end up throwing the baby out with the bath water.

But whatever, this thread has run its course I feel. If any newbie DOES read this best to view it as an ambitious wish list for a utopian society where everyone on earth holds good physics qualifications, knowledge of programming structure and the etiquette of Oscar Wilde.

Please don't despair; in reality, help will be found here.

Argh, meant to end on a positive note...so...help will be found here.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Robin2 on Jan 21, 2018, 10:52 am
Lots of people are discovering Arduino for the first time often after it's been portrayed to them as the magic box that can do anything. They get one and then realise they've done the equivalent of buying a Lotus kit car with no idea of how to put it together
There is a lot of truth in that - especially the magic box bit.

But it is a great "magic box" when you know how to use it.

How do you get that message across while at the same time saying to the person who knows nothing about it "but you need to be prepared to take the trouble to learn how"


Just to illustrate the "magic box" bit - someone asked me if a simple display could be automated. I will probably knock up a demo using an Uno and show it to them. You could probably do what is required a bit more cheaply with a few transistors and a relay - but it would take me a lot longer to do it that way.

...R
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Jan 21, 2018, 11:05 am
Quote
For the newbies; yes, expecting unpaid third party effort just because you ask for it would not happen in any other field...
I don't believe that's always the case...  often they want to create that 'killer app' equivalent, but are simply too lazy to put in even the minimal effort to understand the difference between input & output, or 'blocking' code.

Engage the effort wth meaningful conversation, uninterrupted by your xbox...

Quote
For the experts...if you think every newbie is a wannabe dev, you're asking for disappointment. Lots of people are discovering Arduino for the first time often after it's been portrayed to them as the magic box that can do anything.
I think we can all agree and understand that sentiment, but a beginner honestly asking a question (which can be rare), is even less likely to listen or participate in answering his own question.

Sure, we all want to *help each other*, but the one-way street isn't appealing to those that have already put in the hard work... 10-20 year ago.  Sadly, Over time, goodwill evaporates, and all forums will devolve when the experience leaves, and the remnants are learners spruiking 'String' functions, and robot-in-a-box projects on Indiegogo.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Jan 21, 2018, 11:20 am
Quote
This Thread is no longer a Tutorial.
I reckon it should be moved to Project Guidance so as not to confuse newbies looking for tutorials.
...R
Sorry, I missed this comment earlier...
I wonder if there is a stat available for those users with <10 posts hitting the Tutorials first vs going straight into big-boy's questions...

It sounds draconian, but it could help real novices by setting barriers to some groups before they can post, but of course there are genuine users that come in to ask a legitimate question.

(That should generate some flames,)
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 21, 2018, 07:59 pm
Just because someone is new here does not make them inexperienced at programming or electronics.

And damn, I was sure that at least the top forum sections all have a  How to use this forum - please read. thread.

The most "give me code/do my work" threads I've seen (by far) come from students trying to find a ripcord for their procrastination-parachute. How do you get to final project time, the last week or less and only then seek help? Busted....

We also get people with backgrounds that cover what's needed for Arduino in spots only but are loathe to start back on square 1 and work through even just the basics. The "fun" parts for us are finding the holes at the rate of at least 2 thread pages for each and then spending several more trying to convince the OP that yeah it needs to be dealt with.

We really try to help people and for the most part we do very well.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Grumpy_Mike on Jan 21, 2018, 10:53 pm
Quote
We really try to help people and for the most part we do very well.
Judging by the number of threads we get saying "thank you" I think we do rather well.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Kiwi_Bloke on Jan 26, 2018, 09:51 pm
As a newbie with little experience in electronics or programming (I have programmed at low level Rockwell/Allen Bradley and Schneider SLC and PLC Ladder logic controllers), my advice to fellow newbies would be read as much as you can, start small, try the demo sketches and think about how they work then ask targeted questions.

Be prepared to get caustic responses from experienced members who see the same question over and over but always look at the WHOLE response because there is normally some clue to finding the next step on Google.

Please read and understand the stickies about how to post code and circuit diagrams etc, even I get frustrated when I see a post looking for a high level solution and the poster hasn't even worked out the difference between Delay and Milllis timing.

Don't just vanish half way through the thread, if you find another solution say so, if you can the project say so, if it all gets too hard say so.

Regardless of the outcome a simple thank you to the people who tried to help goes a long way, simple manners don't cost.

Most of all have fun!!

Kia Kaha
Kiwi





Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Jan 26, 2018, 10:16 pm
Thanks kiwi - a refreshing reply, taking responsibility for your own learning!
The older guys can take the lead in teaching, but can't do both.

Most of all, have fun.  Kia Kaha!
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Kiwi_Bloke on Jan 26, 2018, 11:48 pm
Thanks kiwi - a refreshing reply, taking responsibility for your own learning!
The older guys can take the lead in teaching, but can't do both.

Most of all, have fun.  Kia Kaha!
The "older guys" can only teach (and maybe mentor?) those that want to learn.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 27, 2018, 01:01 am
The hardest thing to teach is anything new to the student. There seems to be some kind of horror of the unknown.

So what is behind a section 2 Arduino tutorial example (BWD) becomes hard perhaps because anything so key must be?
Consider that arrays and loops are section 5 beginner tutorial material.

Maybe the hardest thing is believing how simple it can be even when that is shown?

I posted an example that has two tasks in loop(); one that blinks led13 if a flag variable is set and another task that watches Serial for a newline char and when it gets one, toggles the flag and turns the led on or off to match the flag. It's a blinky with stop and start control, it is short.

So far only experienced members seem to fathom that it's not black magic or science so advanced it's indistinguishable from black magic. I have to wonder if those who don't get it are able to follow code line by line at all. Perhaps not.

Learning to follow code line by line is more important than learning all the commands. If you have any doubt about a command or its use you can look it up and find out, just doing that will strengthen your memory till you get it right by habit. It's a matter of personal development, why fight that?
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Jan 27, 2018, 01:15 am
Quote
Maybe the hardest thing is believing how simple it can be even when that is shown?
Without being disrespectful to 'those' learners - they quite seriously ma be better suited to Meccano, Lego or other physical hacking.
Not every person has logical and intangible problem-solving skills.... and god knows the software/tech community often need mechanical hackers to help!
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Kiwi_Bloke on Jan 27, 2018, 01:34 am
I posted an example that has two tasks in loop(); one that blinks led13 if a flag variable is set and another task that watches Serial for a newline char and when it gets one, toggles the flag and turns the led on or off to match the flag. It's a blinky with stop and start control, it is short.

So far only experienced members seem to fathom that it's not black magic or science so advanced it's indistinguishable from black magic. I have to wonder if those who don't get it are able to follow code line by line at all. Perhaps not.
Would you mind reposting the link to that please? I could use that in my ongoing Data logger project.

Thanks
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 27, 2018, 02:24 am
Here ya go. I had to do a fix to make led13 shine bright like it should. The other night it flashed weakly because the led on pin 13 can get small current bleed due to how it's wired. So I added the pinMode() line and now it's as bright as it should be. It was late and I wanted done so I took flashing as my sign it worked... oh well, it's brighter now!

Code: [Select]

// Blink with serial control, free for the Arduino.cc forum members and archives.
// Set your Serial Monitor for 115200 baud with newline printed at end of entry.
// Made on UNO R3 with IDE 1.6.9
// By GoForSmoke 1/24/18

#include "Arduino.h"                  // 1

unsigned long blinkStart, blinkWait = 250;       // 2
byte doBlink = 1, ledState = 1;                  // 3
const byte ledPin = 13;                  // 4


void setup()                  // 5
{
  Serial.begin( 115200 );                  // 6
  pinMode( ledPin, OUTPUT );                 // 7
}

void loop()                  // 8
{
  if ( doBlink )                  // 9
  {
    if ( millis() - blinkStart >= blinkWait )                  // 10
    {
      blinkStart += blinkWait;                  // 11
      digitalWrite( ledPin, ledState );                  // 12
      ledState ^= 1;                            // 13
    }
  }

  if ( Serial.available())                  // 14
  {
    if ( Serial.read() == '\n' )                  // 15
    {
      ledState = doBlink ^= 1;                  // 16
      digitalWrite( ledPin, ledState );                  // 17
    }
  }
}
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Kiwi_Bloke on Jan 27, 2018, 05:50 am
Thanks it works (after i noted to select newline :smiley-confuse: )
Is there a way to make it a specific number or better still a phrase or word?
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GoForSmoke on Jan 27, 2018, 07:29 am
Well yes though you might want to work up to the word-recognition.

How comfortable are you with this sketch? Is any of the syntax not familiar?

Most important is do you understand how it works? It's a bit like a running motor with a 1 speed plus neutral gearbox, isn't it?

With you on solid ground about this then it's next step time, you can skip the 1st tutorial listed in my sig space below though you might want to scan through his (very good) explanations to catch the parts on blocking vs non-blocking code and see what techniques he uses. Good technique is worth stealing... errrr, copying!

If you are solid on the above, go to this tutorial (  http://www.gammon.com.au/serial ) and scroll down to part 2, State Machine.

I think that this is close to what you want. The step to recognizing command words means adding states to collect the chars that make the word, watching that each in turn does match and to handle errors when the input text does not match.

Quote
State Machine


Another way of processing incoming data, without blocking, is to set up a "state machine". Effectively this means looking at each byte in the input stream, and handling it depending on the current state.

As an example, say you had this coming into the serial port:


R4500S80G3


Where Rnnn is RPM, Snnnn is speed, and Gnnnn is the gear setting.

The state machine below switches state when it gets a letter "R", "S" or "G". Otherwise it processes incoming digits by multiplying the previous result by 10, and adding in the new one.

When switching states, if first handles the previous state. So for example, after getting R4500 when the "S" arrives, we call the ProcessRPM function, passing it 4500.

This has the advantage of handling long messages without even needing any buffer, thus saving RAM. You can also process message as soon as the state changes, rather than waiting for end-of-line.
So anyhow the next step is yours if you want to take it. Start a thread about your particular code and leave an invite back here. If you have any questions be sure to ask, trouble-shooting is about eliminating unknowns so it's easier to spot errors which we ALL make.
Part of writing compiled code is that if you write much you have to deal with being wrong many times before lunch until you have the code tamed at least, then you're wrong less times per hour. If you're hardly ever wrong, you're probably not doing much either. If you're never wrong you probably don't write code at all, just sign the checks and make the deadlines.

Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: 232 on Feb 14, 2018, 06:28 pm
I have been reading thru this post by forum participants  with more than 10 posts under their belt.
In past week I also read few first time posts and followed some of the resulting discussions.
It seems that an average discussion lasts few pages and seldom involves the original poster.

Maybe this particular discussion would be more useful, it is IMHO just bunch of vents, to have you "frequent flyers" attempt to analyze why beginners ( in Arduino forum in particular) behave in real world and not in your naive outlook HOW they should behave.

Perhaps a fresh look on some of  the long winded "how to" tutorials is due instead of this group exchanging views on beginners misbehaving.

For example - most first time code post are poorly formatted because IDE formater is buried somewhere, if it even is documented.

Maybe beginners with short attention span would benefit  from simple one liners"how to " instructions.
In no particular order order :

Comment your code to avoid "what it does ?" replies.
Use code formater before posting your code
If it does not compile it won't run
Turn on ALL (compiler) error monitoring
Referring to "line number " is useless when you did not turn "line"  on.
Post ALL error messges ( memory is cheap )
Check you sketch logic structure BEFORE troubleshooting hardware
WRITE , for yourself, down WHAT your sketch suppose to do.
There are three basic "problems" when writing software
1. Typos
2. Code syntax errors _. such as ; in wrong place
3. Logical errors - == versus =, reading serial data and not collecting the results..
Do not apologize if your are  a beginner
Do not apologize for your poor English
Use "scaffolding" (google)  to help to pin point the issue




Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Robin2 on Feb 14, 2018, 07:37 pm
Maybe beginners with short attention span would benefit  from simple one liners"how to " instructions.
In no particular order order :

Comment your code to avoid "what it does ?" replies.
Use code formater before posting your code
If it does not compile it won't run
Turn on ALL (compiler) error monitoring
Referring to "line number " is useless when you did not turn "line"  on.
Post ALL error messges ( memory is cheap )
Check you sketch logic structure BEFORE troubleshooting hardware
WRITE , for yourself, down WHAT your sketch suppose to do.
There are three basic "problems" when writing software
1. Typos
2. Code syntax errors _. such as ; in wrong place
3. Logical errors - == versus =, reading serial data and not collecting the results..
Do not apologize if your are  a beginner
Do not apologize for your poor English
Use "scaffolding" (google)  to help to pin point the issue
Your concept is good but I'm not sure that your one-liners would be as obvious to a beginner as you think.

In this Thread (http://forum.arduino.cc/index.php?topic=527381.0) there seems to have been general agreement that tutorials should not include rambling discussion. However I have not been able to persuade others of the virtue of only having a few items in the beginner's tutorial section.

And the problem of implementing and policing any system has not been resolved.

A big problem in dealing with beginners is that everyone is only a beginner for a very short time and what seemed like a mountain when the person was truly a beginner quickly changes to the smoothness of a putting green. In your one-liners I sense this is beginning to happen to you, also. And, of course, one needs to have knowledge (i.e. to be on the putting green) to impart it to a beginner.

It is also important to distinguish between beginners who are ignorant in the sense of absence of knowledge and those who are ignorant in the sense of discourtesy and bad manners.

Computer programming requires great clarity of thought and the compiler is brutally unforgiving. I find it hard to reconcile an expectation of getting a program working when the person's Post clearly shows that they cannot follow simple instructions and don't have the initiative to try to solve their problem with the aid of Google who puts the whole world of knowledge at one's fingertips. Perhaps the problem is that a false aura of simplicity has been created around the concept of programming because so many software products are available for free or very cheaply and the hundreds or thousands of hours needed to create them are not visible.

...R
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Feb 14, 2018, 09:00 pm
@Robin2 is right...
sometimes the rambling discussion is needed to put specific explanations i. context.
A simple one-liner will only help if the person knows what they're trying to achieve, and 'how to hold the hammer'. Often they don't!

As the OP, I start these threads to attract learners with the topic name, then to stimulate critical thinking, conversation and coding strategy.
Your list above is well informed, but learners often don't want to read, can't understand what is written, or are too impatient to put in the hard yards...

Remember the stages of learning
* Unconscious Incompetence
* Conscious Incompetence
* Conscious Competence, and finally
* Unconscious Competence....

Consider these representing the starting point, 6-months, 12-months, and 2 years milestones of a dedicated beginner's learning cycle --- assuming they have access to a well informed tutor.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: GreyArea on Feb 15, 2018, 01:19 am
I find the best teachers are those at the "conscious competence" stage. They know how to do it, but they still have to think about it...

There's a risk that an assumption of knowledge creeps in at the unconscious competence stage ("I'm sure I knew this when I was at your stage...") so sometimes critical information can be omitted...and sometimes a little frustration creeps in when it has to be re-explained at a later stage.

It's harder to do in an internet forum, and arguably noobs with their "I want it now" attitude don't help...but a good teacher always checks the existing knowledge of their student.

I just realised this whole thread put me in mind of a real story my best mate once told me.

His younger sister would often get punctures on her bike and always asked Big Bro to fix them. She'd be about ten, him about 15. One day he said..."Come on then, I'll show you how to do it."

Her priceless reply...

"I don't WANT to know how to do it. I want YOU to do it FOR me!"

Hmm, I wonder if she visits this forum... :-)

Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: LesserMole on Feb 15, 2018, 06:06 am
Her priceless reply...
"I don't WANT to know how to do it. I want YOU to do it FOR me!"
In principle, there's nothing wrong with that attitude, as long as one realises that in real (adult) life with no big brother, $$$ usually need to change hands.

I'm very bad at making a nice job of window putty: I pay people to replace window glass for me. I really cba to learn how to do it efficiently, effectively and neatly. It's worth $$$ to me, not to have to worry about crap like that.

That's presumably why this forum has has the gigs board: someone might think Arduino could be a solution to some problem and (perhaps after a quick dabble) realise they don't have the skill, background or quite simply the inclination to figure out how to do it themselves. Pay someone, turn the key, vroooooom. Problem solved.



Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: Robin2 on Feb 15, 2018, 09:17 am
Her priceless reply...

"I don't WANT to know how to do it. I want YOU to do it FOR me!"
Some people seem to get through life effectively with an attitude of "pretend helplessness" There are people who respond well to that attitude and do the necessary chores - usually in return for "Gee Gerry (or Mary), you're great, whatever would I do without you"

In the real world where people can see each other it may be that those types easily identify each other, and equally easily avoid others who don't want to play the game.

If so, maybe the crunch comes when the "pretend helpessee" gets told "learn how to do it yourself" by a Forum member who is not interested in being a patsy.

...R

Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: lastchancename on Feb 15, 2018, 11:02 am
...and a lot of 'these people' drive cars!
Aargh! Help us all.
Title: Re: BEGINNERS: We rarely write code for you, but will help you write it for yourself
Post by: RIN67630 on Apr 23, 2018, 10:13 pm
The good thing with an Arduino, is that the learning cuve is not that steep.

If you have got basic knowledge in physics and just a basic understanding of how to code, you may get some results pretty quickly.
That is because we are working rather close to bare metal and control everything directly.

With more elaborated systems like a Raspberry Pi under Linux you must have digested so much conventions, and rules before you ever can begin to code, that you get stuck very fast to nothing more than printing stuff on the console.

That advantage turns also to be our problem, since many noobs get more stuff done here and gets appetite, but are still noobs.