Mike Poole | 03/08/2017 11:12:27 |
![]() 3676 forum posts 82 photos | It might make an interesting project to decode the atomic clock slow code time signal, it will require the construction of a receiver but then you will have a BCD code to decode store and display. I decoded this in a PLC many years ago when accurate time for PLCs was hard to get, there is even the opportunity to implement a parity check. Mike |
I.M. OUTAHERE | 03/08/2017 12:19:08 |
1468 forum posts 3 photos | I just want to add something for anyone who comes along looking for arduino info , one of the books that i used is arduino workshop - a good starting point but not sure if available in all countries . One of the best things about arduino is if you have a pc , an internet connection and a few dollars you are in business ! One of the things Paul Mcworter keeps harping on about is keeping your sketch neat and tidy , if you look around on youtube or the internet you will find many sketches are difficult to read many don't work or won't compile and if your lucky the IDE will tell you whats wrong . Ian. |
Andy Holdaway | 03/08/2017 12:36:05 |
![]() 167 forum posts 15 photos | +1 for XD 351 I started with Arduino a few years ago, and used the example sketches bundled with the IDE to get an initial understanding of what's going on. Start with 'Blink', you can't go wrong. I would also add that neat code is far easier to debug and understand - break operations down into blocks so that it's not a continuous stream of lines, and comment every line to start with. It's surprising how you know what you meant when you wrote it, but it can be a complete mystery when you go back to it days later! Andy |
Brian Oldford | 03/08/2017 13:10:00 |
![]() 686 forum posts 18 photos | I'm also a relative newcomer to Arduino along with its C/C++. As someone who has only played with BASIC at very much a novice level I can understand the difficulty some people may find. Before even attempting to write code I think the real solution is to draw up a robust flow chart of what you are trying to achieve. This way you are likely to cover all eventualities and thus lead towards robust code. |
I.M. OUTAHERE | 03/08/2017 13:54:11 |
1468 forum posts 3 photos | You can break most things up : Global variables ,setup and your loop . So i think Brian has hit the nail on the head for beginners , work on a section at a time on paper then once you're happy punch it into the IDE and see if it compiles . |
SillyOldDuffer | 03/08/2017 15:12:18 |
10668 forum posts 2415 photos | Posted by Thomas Staubo on 02/08/2017 15:44:57:
The programming is the hard part for me. You can say it's greek to me. Electronics I can manage far better. I searched for "Arduino GUI" to see if there's an easier way. And there seems to be several GUI based programs, but I don't know if it's something for serious use, or if it's just for kids use. Anybody tried something like that?? I've played a little with Ardublock and am in two minds about it. In some ways it simplifies, in others it obstructs! If I were running a course I'd happily use Ardublock to introduce learners to structured programming and to Arduino basic concepts. The block sketches could be projected on the wall and a teacher could explain what it does quite easily. A few questions and answers and the class would 'get it'. I'm much less sure about recommending Ardublock to a self-learning beginner. Although the tool hides the need to learn 'C' syntax, editing and compile/upload, you still have to understand Ardublock Semantics and program design. In my experience, the hardest part of programming is design and understanding what the computer language means so you can implement the design. I couldn't find a Reference or a good set of Tutorials for that aspect of Ardublock. The biggest objection though is that Ardublock is limited compared with writing a Sketch with the Arduino IDE. The IDE has a complete language and can create and call libraries etc. For example, when using serial I/O, it's usual to set the baud rate in setup(). Ardublock doesn't appear to support that simple requirement; it assumes that the default settings will be fine. That's OK in classroom, but not in the real world. The easiest way to get into Arduino is to buy a starter set (any of them will do,) and to download the Arduino environment. It comes with many examples and comprehensive reference material. Also, because it uses a fairly complete C/C++ compiler most online C/C++ documentation and books will makes sense. There are many Arduino specific books; the main variation being what you intend to connect to the Arduino, and the sophistication of your interest. (Basic electronics, Ham Radio , Robots, Sensors, machine control etc.) You have to be a little wary programming the Arduino. Not everything is implemented because it's a tiny computer. Annoyingly, Arduino sprintf() doesn't implement string formatting because the resulting big program won't fit on an Arduino. On the other hand, the PC-based compiler is pretty much full strength so smarty-pants can still use 'advanced' features like C++ Templates. The important thing is to get stuck in. Fretting about being a dinosaur doesn't help. Give it a try and see how you get on. There are plenty of people who can answer questions and the worst that can happen is you waste a few quid. Don't be embarrassed if you find it's not your cup of tea: many clever people hate computers! Dave |
Robin Graham | 03/08/2017 23:57:30 |
1089 forum posts 345 photos | Posted by Neil Wyatt on 02/08/2017 16:40:49:
Posted by Robin Graham on 01/08/2017 23:17:20:
As computing has evolved, layers upon layers of abstraction have covered up what's 'actually' going on. That makes it easier for some folk, but harder for a dinosaur like me. In that case, you might enjoy programming arduinos (well the AVR chips on them) in AVR assembler. No nasty abstractions to spoil the experience and hugely powerful chips! Neil Arf! I might well Neil! I'm not actually waging a war against 'nasty' (not my word!) abstractions. I confess that I might have made use of printf on odd occasions. Coding a big program like Microsoft Word, for example, in pure machine language or even assembler would have perhaps been impossible , and we certainly would have been deprived of life-enhancing features like the paperclip. Or this thing which substitutes 'this' when I type 'that'. Because it knows better. But on the other hand, if you had to code this sort of nonsense in assembler - well, you'd think twice about it wouldn't you? And worry about bloat? I've steered the abstraction of my finger to the OneClick 'button' on the Amazon offering which Jouneyman John recommended, so expecting a parcel tomorrow. As (not so Silly)OldDuffer says, best to just dive in and see what happens. For those finding the C language confusing, I would recommend Kernighan and Ritchie. It's an old book now, but it it explains very clearly how the syntax works - as you might expect from the chap who made it up. Thanks again for advice, Robin Edited By Robin Graham on 04/08/2017 00:09:54 |
Russell Eberhardt | 04/08/2017 11:23:57 |
![]() 2785 forum posts 87 photos | One thing I don't like about the C language is that if you misspell or miss-type the name of a variable the compiler doesn't flag an error but assumes a new variable and your program will have a bug which can be difficult to find. When I started programming in the 1960s with Algol you had to declare all variables at the start of the program (or subroutine) and any undeclared variables were flagged by the compiler. Russell |
duncan webster | 04/08/2017 12:12:09 |
5307 forum posts 83 photos | with the IDE/compiler I use (CodeBlocks) I declare variables at the start, if I try to use one which hasn't been declared it throws a hissy fit. You can declare them as in the body of the prgram, but you have to tell it what type eg int eric = 4; I don't like this, but it's a style issue.
|
SillyOldDuffer | 04/08/2017 12:21:19 |
10668 forum posts 2415 photos | Posted by Russell Eberhardt on 04/08/2017 11:23:57:
One thing I don't like about the C language is that if you misspell or miss-type the name of a variable the compiler doesn't flag an error but assumes a new variable and your program will have a bug which can be difficult to find. When I started programming in the 1960s with Algol you had to declare all variables at the start of the program (or subroutine) and any undeclared variables were flagged by the compiler. Russell Many languages do that Russell but 'C' isn't one of them. C was much influenced by ALGOL including making it essential to declare variables up front. One circumstance that might create your 'no error' symptom in C is when compiling a module. (A module is a separate compilation unit that will be linked into the main program later. ) Finding an undeclared variable inside a module the compiler might assume that the variable has been declared in another module, which it doesn't know about. The last stage of the compilation process is to call a linker to glue all the parts together. If the variable isn't defined in any of the parts, a link error will be thrown. Quite likely the error message output by the linker will be unhelpful and, until you've twigged it, might be mistaken for a difficult to find bug. I have fond memories of Algol60 - much cleaner than contemporary COBOL, FORTRAN and BASIC. It was primitive though; weird input-output, and I don't think it supported modules at all. Dave |
Please login to post a reply.
Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!
Sign up to our newsletter and get a free digital issue.
You can unsubscribe at anytime. View our privacy policy at www.mortons.co.uk/privacy
You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.
Click THIS LINK for full contact details.
For subscription issues please see THIS LINK.