Arduino code sources?

On a sunny day (Sat, 1 Jun 2019 07:50:19 +0100) it happened Tom Gardner
<spamjunk@blueyonder.co.uk> wrote in <LepIE.530049$fq5.523213@fx27.am4>:

What you gain on the swings you lose on the roundabouts.

While I am certainly no fan of C++ (e.g. see the C++ FQA),
one advantage of the Arduino class machines is that you are
programming against bare silicon.

Having an operating system in a hard real-time system can
be a real impediment and a steep learning curve.

Yes this is true.
But if you want no [multitasking] OS and no task switching
still programming in C (or asm) is more logical.

Not all OSes are multitasking, old CP/M comes to mind.
I once wrote a clone of that (in Z80 asm of course).
That thing then ran the Software Toolworks C80 C compiler on top of it.
My advice:
Start from the bottom up!

The point is also that even without OS you can have many libraries,
I have written many C libraries, and also asm libraries for Microchip PIC.
The advantage of the C libraries is [1]) that that is portable to many micros.

Having libraries makes life so much simpler and coding so much faster,
and it gets better over time as you create more.

[1] I hope it is not all replaced by 'pythons'.

'duinos are cheap, and have a large following that is for sure.
But there are other things at the horizon from China.

ARM was sold by the UK to Japan last year, not sure where that will go,

mm now geting real serious.
 
On a sunny day (Fri, 31 May 2019 23:34:18 -0700 (PDT)) it happened "John
Miles, KE5FX" <jmiles@gmail.com> wrote in
<6f705876-d6c3-4be8-a265-1157f020757d@googlegroups.com>:

On Friday, May 31, 2019 at 9:57:40 PM UTC-7, Jan Panteltje wrote:
The Cplushplush I have seen for 'duinos is total insane.
Cplushplush is a crime against humanity.

Learning it is going back to the stone age making stone tools.

If someone is just getting started, it amounts to pedagogic malpractice to
tell them to learn anything else. The world still runs on C, and someone
who has learned C++ will be equipped to write better code than someone
who has not even if they never use 99% of the language. The only question
is where they should be looking for lessons.

Probably not here, would be my guess.

I do not use 'duinos and never will, just because of that Cplushplush.

It's just another AVR board, irrespective of your personal prejudices.
If you have an 8-bit nail to pound, Arduinos make a good 8-bit hammer.
You can program them in C, or Forth, or Brainfuck if that's your thing.

I completely .. yes Cplushplush IS a crime against humanity :)


Sure you can probably program a 'duino in C.
Or maybe pythons.

Asm on an ARM never was appealing to me,
let the C compiler do the register stuff.
Yet even there there are limits.

You need a different POV, what sort of processing power do you need?
For many things a PIC is simpler.
Especially the projects I see on the net.

And for more complex things a Raspberry Pi programmed in C,
maybe with some additional hardware to deal with task interrupts.

Before starting with programming people should understand and design some hardware and logic circuits.

There is my history.

As to you 'Probably not here, would be my guess.'
this is an electonix design group, OTOH there is lots of code on my website where you can get a clue
HOW to program.
Others here have written operation systems and all sorts of software, very few here (dare?) to publish code let alone working applications.
I am the exception there.

So you COULD learn something from what I scribble here.
heh
:)

Probably not if you play with pythons...

I see we are now heading into the this system versus that system fight, so waste of time.
For the other lurkers maybe 1 in a thousand will pick something up from what I wrote.
If not your problem.
Cookies here taste just as good, and it ain't raining.
Heading for the garden.
 
On 6/1/19 2:34 AM, John Miles, KE5FX wrote:
On Friday, May 31, 2019 at 9:57:40 PM UTC-7, Jan Panteltje wrote:
The Cplushplush I have seen for 'duinos is total insane.
Cplushplush is a crime against humanity.

Learning it is going back to the stone age making stone tools.

If someone is just getting started, it amounts to pedagogic malpractice to
tell them to learn anything else. The world still runs on C, and someone
who has learned C++ will be equipped to write better code than someone
who has not even if they never use 99% of the language. The only question
is where they should be looking for lessons.

Learning programming is probably best done with a scripting language.
BITD it was interpreted BASIC, but now probably Python.

For learning real programming (i.e. not webdev) I still think C is a
good place to start. (I started with Fortran 77 myself.) C is a nice
small language that you can get your arms around, and the standard
library is a mix of useful stuff and a few cautionary tales, e.g.
strcpy(). To write good code you have to have some idea what's going on
under the hood, so it's good to know your way around pointers, data
structures, and so on. Once you've written a few thousand lines of
nontrivial C, you'll never again be confused by pass-by-value vs
pass-by-reference, for example.

For the last 15 years or so I've written most of my compiled code in
C++03, and am just now getting up to speed on the modern variety.
There's a lot of gingerbread I'll never need, but there is also a lot of
good stuff--improved smart pointers, constexpr's, atomic variables,
built-in support for threads and mutexes, to name but a few.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510

http://electrooptical.net
http://hobbs-eo.com
 
On Fri, 31 May 2019 17:02:54 -0700, John Miles, KE5FX wrote:

The advice to start with K&R C is OK as far as it goes, but it's akin to
telling an electronics novice to start with vacuum tubes.

What's wrong with that? Learning how chewbs work provides an extremely
valuable intermediate step to learning how transistors and other semis
function. Certainly if I hadn't learned valves first (at the age of 9)
I'd have had a markedly tougher time of it when it came to grasping tranny
theory.



--
This message may be freely reproduced without limit or charge only via
the Usenet protocol. Reproduction in whole or part through other
protocols, whether for profit or not, is conditional upon a charge of
GBP10.00 per reproduction. Publication in this manner via non-Usenet
protocols constitutes acceptance of this condition.
 
On Sat, 01 Jun 2019 04:57:29 +0000, Jan Panteltje wrote:

The basic flaw with that seeplushplush is that it claims to look at
things from on 'object oriented' POV.

IIRC, the OP hasn't said why or even *IF* he needs an Object Orientated
language for what he plans to do.

Cpluplush is unreadable crap and should be forbidden by law and those
that still use it banned to a deserted island on an other planet in an
other solar system in an other galaxy in an other universe ruled by
string theory.

+1


--
This message may be freely reproduced without limit or charge only via
the Usenet protocol. Reproduction in whole or part through other
protocols, whether for profit or not, is conditional upon a charge of
GBP10.00 per reproduction. Publication in this manner via non-Usenet
protocols constitutes acceptance of this condition.
 
On 6/1/19 2:50 AM, Tom Gardner wrote:
On 01/06/19 05:57, Jan Panteltje wrote:
sniiiip
Cpluplush is unreadable crap and should be forbidden by law and those
that still use it banned to a deserted island on an other planet in an
other solar system in an other galaxy in an other universe ruled by
string theory.

What you gain on the swings you lose on the roundabouts.

Or the backandforths, in cricket. ;)

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510

http://electrooptical.net
http://hobbs-eo.com
 
On 1/6/19 4:50 pm, Tom Gardner wrote:
What you gain on the swings you lose on the roundabouts.

While I am certainly no fan of C++ (e.g. see the C++ FQA),
one advantage of the Arduino class machines is that you are
programming against bare silicon.

If you think that 120 CPU cycles to set or clear a port pin is "bare
silicon" then I don't know what to think. That's how long "digitalWrite"
takes to perform a 2-cycle operation.

The Arduino C libraries are a really bad direction to start off in, even
for a raw beginner. They are so unnecessarily so very badly implemented.

Having an operating system in a hard real-time system can
be a real impediment and a steep learning curve.
 
Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote in
news:etKdnTiAveP1ym_BnZ2dnUU7-V_NnZ2d@supernews.com:

On 6/1/19 2:50 AM, Tom Gardner wrote:
On 01/06/19 05:57, Jan Panteltje wrote:
sniiiip
Cpluplush is unreadable crap and should be forbidden by law and
those that still use it banned to a deserted island on an other
planet in an other solar system in an other galaxy in an other
universe ruled by string theory.

What you gain on the swings you lose on the roundabouts.

Or the backandforths, in cricket. ;)

Cheers

Phil Hobbs

Don't forget to include the influence of the Dark Matter Nodes.
 
On 01/06/19 12:06, Clifford Heath wrote:
On 1/6/19 4:50 pm, Tom Gardner wrote:
What you gain on the swings you lose on the roundabouts.

While I am certainly no fan of C++ (e.g. see the C++ FQA),
one advantage of the Arduino class machines is that you are
programming against bare silicon.

If you think that 120 CPU cycles to set or clear a port pin is "bare silicon"
then I don't know what to think. That's how long "digitalWrite" takes to perform
a 2-cycle operation.

Rank beginners, such as the OP, doing blinkies and
the like won't be affected by that.


The Arduino C libraries are a really bad direction to start off in, even for a
raw beginner. They are so unnecessarily so very badly implemented.

No way am I going to defend Arduino for people that
know what they are doing.

But for rank beginners, they offer a low cost of entry
and gentle learning curve. That's valuable in those
circumstances.

Only after they even notice the limitations, will they be
in a position to do something about it.


Having an operating system in a hard real-time system can
be a real impediment and a steep learning curve.
 
lørdag den 1. juni 2019 kl. 12.45.13 UTC+2 skrev Terry Pinnell:
Terry Pinnell <me@somewhere.invalid> wrote:

I bought my first Arduino UNO R3 kit two weeks ago (the Elegoo Super Starter kit)
and am stepping through its tutorials. In parallel I'm trying to learn the basics of
its C++ based programming language, but that's proving a struggle. I'm impatient to
use Arduino on my own projects so I will take a 'copy/paste/edit' approach. It then
becomes a matter of finding sketches that cover a particular subject and then
tailoring.

I'd therefore appreciate recommendations on Arduino sketch sources that others have
found useful please.

Terry, East Grinstead, UK

Thanks to those who suggested useful sources of code, a couple of which I've added
to my already extensive 'Arduino Code' bookmarks.

As per my opening post, I am already stepping through the Elegoo tutorials, some 37
projects. And dipping in and out of two other sets.

As also explained, I don't want to master either C or C++. I want to reach the stage
I described: minimal competence for a copy/paste/edit approach.

https://en.wikipedia.org/wiki/Cargo_cult_programming

;)
 
On 01/06/19 11:45, Terry Pinnell wrote:
> Unless there's a superbly indexed site I haven't yet found, perhaps that's enough.

There is such a site, with wonderful indexes. It is
called google, and knowing how to use it effectively
is a key modern skill.

It isn't difficult; my 10yo quickly mastered it
sufficiently that she demolished my arguments about
why we shouldn't get chickens. Made me proud, and
glad to get them.
 
Terry Pinnell <me@somewhere.invalid> wrote:

I bought my first Arduino UNO R3 kit two weeks ago (the Elegoo Super Starter kit)
and am stepping through its tutorials. In parallel I'm trying to learn the basics of
its C++ based programming language, but that's proving a struggle. I'm impatient to
use Arduino on my own projects so I will take a 'copy/paste/edit' approach. It then
becomes a matter of finding sketches that cover a particular subject and then
tailoring.

I'd therefore appreciate recommendations on Arduino sketch sources that others have
found useful please.

Terry, East Grinstead, UK

Thanks to those who suggested useful sources of code, a couple of which I've added
to my already extensive 'Arduino Code' bookmarks.

As per my opening post, I am already stepping through the Elegoo tutorials, some 37
projects. And dipping in and out of two other sets.

As also explained, I don't want to master either C or C++. I want to reach the stage
I described: minimal competence for a copy/paste/edit approach.

I'm seeking feedback from other Arduino users on the sources they've found most
useful to find sketch code to help them with a specific project or section of one.

My current sources apart from tutorial projects are the obvious Google Search, the
Arduino Forum, and the Embedded Systems and Micro controllers section of the All
About Circuits Forum.

Unless there's a superbly indexed site I haven't yet found, perhaps that's enough.

Terry, East Grinstead, UK
 
Tom Gardner <spamjunk@blueyonder.co.uk> wrote in news:kotIE.628549
$Qy4.145498@fx04.am4:

Only after they even notice the limitations, will they be
in a position to do something about it.

More expensive, but far superior...

<https://www.solid-run.com/>

or better

<https://www.solid-run.com/nxp-family/hummingboard/>

Want Windows on it?

<https://www.solid-run.com/intel-braswell-family/solidpc-q4/>

Want to do real design and integrate your own full design?

<https://www.solid-run.com/nxp-family/imx8-som/>
 
lørdag den 1. juni 2019 kl. 14.03.24 UTC+2 skrev DecadentLinux...@decadence.org:
Tom Gardner <spamjunk@blueyonder.co.uk> wrote in news:kotIE.628549
$Qy4.145498@fx04.am4:


Only after they even notice the limitations, will they be
in a position to do something about it.



More expensive, but far superior...

in what way? you are comparing a bicycle to a jetliner
 
On Sat, 1 Jun 2019 21:06:36 +1000, Clifford Heath wrote:

The Arduino C libraries are a really bad direction to start off in, even
for a raw beginner. They are so unnecessarily so very badly implemented.

A lot of the C/C++ libraries seem to have been written by people who
are out to prove how clever they are. Some I understood what they were
doing and managed to use them but there were a lot more that just
didn't have sufficiently clear documentation for me to use them. I've
been using 'objects' for nearly thirty years and get along with them
but I found it hard to understand how the developer got from there to
here if you see what I mean.

--
Regards - Rodney Pont
The from address exists but is mostly dumped,
please send any emails to the address below
e-mail rpont (at) gmail (dot) com
 
On Fri, 31 May 2019 11:48:07 +0100, Terry Pinnell wrote:

I bought my first Arduino UNO R3 kit two weeks ago (the Elegoo Super Starter kit)
and am stepping through its tutorials. In parallel I'm trying to learn the basics of
its C++ based programming language, but that's proving a struggle. I'm impatient to
use Arduino on my own projects so I will take a 'copy/paste/edit' approach. It then
becomes a matter of finding sketches that cover a particular subject and then
tailoring.

I'd therefore appreciate recommendations on Arduino sketch sources that others have
found useful please.

I found books easier to get on with than on screen things but I'm an
oldie and a long term programmer.

Arduino for Dummies is good for getting used to Arduino with worked
examples.

Arduino Cookbook published by O'Reilly is also very good and goes into
programming techniques such as loops, decision structures and variable
types. I presume those would be useful to a started in programming. It
states the problem (such as You want to send text and data from your
Arduino to your pc) and then shows a solution.

--
Regards - Rodney Pont
The from address exists but is mostly dumped,
please send any emails to the address below
e-mail rpont (at) gmail (dot) com
 
On 6/1/19 6:06 AM, Clifford Heath wrote:
On 1/6/19 4:50 pm, Tom Gardner wrote:
What you gain on the swings you lose on the roundabouts.

While I am certainly no fan of C++ (e.g. see the C++ FQA),
one advantage of the Arduino class machines is that you are
programming against bare silicon.

If you think that 120 CPU cycles to set or clear a port pin is "bare
silicon" then I don't know what to think. That's how long "digitalWrite"
takes to perform a 2-cycle operation.

That is because digitalWrite() allows you to dynamically assign the pin
at run time. If you have a fixed pin you want to use and speed is
important, you can use builtin assembler operations (DDRx,PORTx,PINx) to
get your two cycle operation. Most beginner projects are more human
speed so 2 or 200 cycles doesn't make much difference.

The Arduino C libraries are a really bad direction to start off in, even
for a raw beginner. They are so unnecessarily so very badly implemented.

Yes some of them are awful, but the more common ones are good and
getting better. For the beginner it lets them easily get something
working even if the dark corners have dragons.

Besides it can be a learning experience going through the library code
to see what is screwed up :) (not for the beginner or faint of heart!).

Having an operating system in a hard real-time system can
be a real impediment and a steep learning curve.
 
Tom Gardner <spamjunk@blueyonder.co.uk> wrote:

On 01/06/19 11:45, Terry Pinnell wrote:
Unless there's a superbly indexed site I haven't yet found, perhaps that's enough.

There is such a site, with wonderful indexes. It is
called google, and knowing how to use it effectively
is a key modern skill.

It isn't difficult; my 10yo quickly mastered it
sufficiently that she demolished my arguments about
why we shouldn't get chickens. Made me proud, and
glad to get them.

That's why it was the first of the three I listed.

Terry Pinnell, East Grinstead, UK
 
On 6/1/19 10:43 AM, Dennis wrote:
On 6/1/19 6:06 AM, Clifford Heath wrote:
On 1/6/19 4:50 pm, Tom Gardner wrote:
What you gain on the swings you lose on the roundabouts.

While I am certainly no fan of C++ (e.g. see the C++ FQA),
one advantage of the Arduino class machines is that you are
programming against bare silicon.

If you think that 120 CPU cycles to set or clear a port pin is "bare
silicon" then I don't know what to think. That's how long
"digitalWrite" takes to perform a 2-cycle operation.

That is because digitalWrite() allows you to dynamically assign the pin
at run time. If you have a fixed pin you want to use and speed is
important, you can use builtin assembler operations (DDRx,PORTx,PINx) to
get your two cycle operation. Most beginner projects are more human
speed so 2 or 200 cycles doesn't make much difference.


The Arduino C libraries are a really bad direction to start off in,
even for a raw beginner. They are so unnecessarily so very badly
implemented.

Yes some of them are awful, but the more common ones are good and
getting better. For the beginner it lets them easily get something
working even if the dark corners have dragons.

Besides it can be a learning experience going through the library code
to see what is screwed up :) (not for the beginner or faint of heart!).

Not a bad method.

I taught myself circuit design largely by reading app notes, assuming
that all the circuits were junk, and figuring out why. (Some of them
are okay, of course, but you can always think about input protection and
so forth.)

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510

http://electrooptical.net
http://hobbs-eo.com
 
On 6/1/19 7:33 AM, Tom Gardner wrote:
On 01/06/19 12:06, Clifford Heath wrote:
On 1/6/19 4:50 pm, Tom Gardner wrote:
What you gain on the swings you lose on the roundabouts.

While I am certainly no fan of C++ (e.g. see the C++ FQA),
one advantage of the Arduino class machines is that you are
programming against bare silicon.

If you think that 120 CPU cycles to set or clear a port pin is "bare
silicon" then I don't know what to think. That's how long
"digitalWrite" takes to perform a 2-cycle operation.

Rank beginners, such as the OP, doing blinkies and
the like won't be affected by that.


The Arduino C libraries are a really bad direction to start off in,
even for a raw beginner. They are so unnecessarily so very badly
implemented.

No way am I going to defend Arduino for people that
know what they are doing.

But for rank beginners, they offer a low cost of entry
and gentle learning curve. That's valuable in those
circumstances.

Only after they even notice the limitations, will they be
in a position to do something about it.


Having an operating system in a hard real-time system can
be a real impediment and a steep learning curve.
Except for the lack of a debugger. Arduino may be C++ish, but its
debugging is strictly 1965.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510

http://electrooptical.net
http://hobbs-eo.com
 

Welcome to EDABoard.com

Sponsor

Back
Top