Arduino code sources?

On a sunny day (Sat, 1 Jun 2019 07:50:19 +0100) it happened Tom Gardner wrote in :

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.

Reply to
Jan Panteltje
Loading thread data ...

On a sunny day (Fri, 31 May 2019 23:34:18 -0700 (PDT)) it happened "John Miles, KE5FX" wrote in :

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.

Reply to
Jan Panteltje

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

+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.
Reply to
Cursitor Doom

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.
Reply to
Cursitor Doom

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
Reply to
Phil Hobbs

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

Reply to
Terry Pinnell

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
Reply to
Phil Hobbs

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.

Reply to
Clifford Heath

Phil Hobbs wrote in news:etKdnTiAveP1ym_BnZ2dnUU7-V snipped-for-privacy@supernews.com:

Don't forget to include the influence of the Dark Matter Nodes.

Reply to
DecadentLinuxUserNumeroUno

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

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.

Reply to
Tom Gardner

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.

Reply to
Tom Gardner

rter kit)

he basics of

mpatient to

ch. It then

then

others have

've added

s, some 37

h the stage

formatting link

;)

Reply to
Lasse Langwadt Christensen

Tom Gardner wrote in news:kotIE.628549 $ snipped-for-privacy@fx04.am:

More expensive, but far superior...

or better

Want Windows on it?

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

Reply to
DecadentLinuxUserNumeroUno

dence.org:

in what way? you are comparing a bicycle to a jetliner

Reply to
Lasse Langwadt Christensen

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
Reply to
Rodney Pont

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
Reply to
Rodney Pont

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.

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!).

Reply to
Dennis

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

Terry Pinnell, East Grinstead, UK

Reply to
Terry Pinnell

Me too.

Me too.

Not me.

I'm currently ploughing through Simon Monk's 'Programming Arduino, 2nd Edition'. Quite readable up to his first complex example, flashing Morse code to the LED from the serial monitor), mainly because of its use of arrays within arrays ;-(

Went straight to your next recommendation as I hope Monk's book and the online tutorials I'm studying will get me to a stage I can benefit from the Margolis.

Thanks, appreciated.

Terry, East Grinstead, UK

Reply to
Terry Pinnell

I found this most helpful. It is a list of the commands and short explination. Near the end there are some short examples of the commands.

formatting link

Reply to
Ralph Mowery

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.