Beginners often start out reading, copying and practising with code snippets from wherever they find them.
Ask questions here, fry a few parts there....
Blink a LED, echo or print chars to the serial console...
Nothing wrong with that at all!
The next step is to wire up some items - switches, LEDs, motors etc - other than the inbuilt LED - to the I/O pins. (?Fry a few more parts!)
Hey this the real world, the computer needs to interact with it... Nothing wrong with that at all!
Now, the problems start with making uninformed assumptions.
While there are many ways for the same software and same hardware to work together, they always depend on immutable logic in the software, and the laws of physics in the combination with hardware.
This topic is far too broad for a single discussion, but suffice to say that on every level, you need to understand WHY you’re doing things - as well as HOW you’re doing them.
*** Try towing a car with a single thread of black cotton... ***
It looks like a kevlar thread, ok, the car is powerful enough, there is air in the tyres... Why doesn’t.. it work?
Sadly, no-one is an expert in anything the moment they’re born. It takes time and effort. Some of us just don’t make it. Blame whomever you want, but step up, or choose another direction!
Try towing a car with a single thread of black cotton...
And therein lies the problem!
Almost everyone jumped to an assumption the car might be full size & weight.
What if it was a small plastic hot-wheels car? Black thread would work fine.
Look before you leap!
(white thread would work too!)
lastchancename:
And therein lies the problem!
Almost everyone jumped to an assumption the car might be full size & weight.
What if it was a small plastic hot-wheels car? Black thread would work fine.
Look before you leap!
(white thread would work too!)
lastchancename:
And therein lies the problem!
Almost everyone jumped to an assumption the car might be full size & weight.
What if it was a small plastic hot-wheels car? Black thread would work fine.
Look before you leap!
(white thread would work too!)
If black thread would work fine then,
It looks like a kevlar thread, ok, the car is powerful enough, there is air in the tyres... Why doesn't.. it work?
GoForSmoke:
That takes ability to understand or even follow code. Not that that stops the occasional beginner of course.
And that's imho a good thing, as otherwise no-one would ever have started in the first place. Very rare that people can understand the very first piece of code they see just like that.
wvmarle:
And that's imho a good thing, as otherwise no-one would ever have started in the first place. Very rare that people can understand the very first piece of code they see just like that.
That's a non-sequitur following a fallacy.
Most everyone who starts is not after instant total gratification, ie setting themselves up for failure.
Just look at how many comp-sci students and grads there are for evidence.
Most of our new people do not expect reality to be a movie/cartoon where things just fall into place.
That's the fallacy. The non-sequitur simply makes no sense, nobody has a priori knowledge of code!
Those who can't take being told they're wrong will not survive a compiler for long.
If you want to run barefoot over stones, you build calluses first or suffer.
If you want to do well in coding then doing that must be your primary reward.
If you want to be mundane then do it for the money and job.
lastchancename:
Actually the original post was ‘serious’ in hoping to attract meaningful understanding that code alone is not enough.
That is true - especially in the Arduino world where one wants to interface with "machines". The writer of code for a fantasy game on a PC does not need to worry about physics.
Maybe all this drivel is evidence that the intended message in the OP might have been phrased more directly ? Perhaps
If you are writing a program for an Arduino project that interfaces with the real world it is pretty much essential to have a good grasp of the physics and engineering associated with your project.
That does not mean that you need to be a qualified physicist or engineer. But there is no point wondering why a project won't work if (for example) you are trying to power a ride-on car with a tiny motor and a PP3 style 9v battery. All an Arduino can do is control something that would otherwise be capable of working without a microprocessor.
Robin2:
All an Arduino can do is control something that would otherwise be capable of working without a microprocessor.
I like that.
It's the Arduino equivalent of what I said over 35 years ago when computing was arriving on the desktop and everyone had a word-processor. What I told people was that having a word-processor didn't make them Shakespeare: you still have to know what you want to say.
For all it’s weakneses and bad-habit forming tendencies, us old guys had BASIC as an introductory tool.
We also had assembler and hand coding machine language to teach us ‘the hard way’!
An interpreter, loose typing, and English-like syntax made BASIC more attractive to develop a ‘simple’ understanding of program flow and structure without paying for courses and formal study.
Suck it and see. No-one died.
It wasn’t mission critical stuff, but it /was/ good enough to write Simon, or send a text message...
The later arrival of BASIC compilers squeezed some of us into ‘better’ habits, along with other compiled environments (Pascal etc) and then onward to more capable toolchains.
I couldn’t have imagined having these tools on my first hardware..l
(512 bytes of RAM, no disk etc)
Later incarnations of language environments have blurred the lines VB.net, Python etc, while they serve a purpose in themselves they also introduce all the abstractions of C, C++ and other more complex languages.
I personally think starting with a comprehensive BASIC interpreter could be a good thing for many newbies, as it develops confidence along with awareness and skills in a simple, rewarding way.
They can grow out of that as soon as they like. Crawl before you walk!