0 valutazioniIl 0% ha trovato utile questo documento (0 voti)
5 visualizzazioni2 pagine
If you type a ; (semicolon) anywhere in your program, the compiler will ignore anything after it until the carriage return. This means we can add comments in our program to remind us of what on earth we were doing. You can assign names to constants via registers (more about these later) it makes it far easier to read in English what you are writing to, or what the value is, rather than trying to think what all these numbers mean.
If you type a ; (semicolon) anywhere in your program, the compiler will ignore anything after it until the carriage return. This means we can add comments in our program to remind us of what on earth we were doing. You can assign names to constants via registers (more about these later) it makes it far easier to read in English what you are writing to, or what the value is, rather than trying to think what all these numbers mean.
If you type a ; (semicolon) anywhere in your program, the compiler will ignore anything after it until the carriage return. This means we can add comments in our program to remind us of what on earth we were doing. You can assign names to constants via registers (more about these later) it makes it far easier to read in English what you are writing to, or what the value is, rather than trying to think what all these numbers mean.
Before we get to the nitty gritty of programming the PIC, I think now is a good time to explain some good programming techniques. If you type a ; (semicolon) anywhere in your program, the compiler will ignore anything after it until the carriage return. This means we can add comments in our program to remind us of what on earth we were doing in the first place. This is good practice, even for the simplest programs. You may well fully understand how your program works now, but in a few months time, you may be scratching your head. So, use comments wherever you can there is no limit. Secondly, you can assign names to constants via registers (more about these later). It makes it far easier to read in English what you are writing to, or what the value is, rather than trying to think of what all these numbers mean. So, use real names, such as COUNT. Notice that we have put the name in capitals. This makes it stand out, and also means that (by convention) it is a constant value. Thirdly, put some kind of header on your programs by using the semi-colons. An example is below: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Author : ; ; Date : ; ; Version: ; ; Title: ; ; ; ; Description: ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Notice that We have made a kind of box by using the semi-colons. This just makes it look neat. Finally, try and document the program on paper as well. You can either use flow charts or algorithms or anything else you want. This will help you in writing your
program, step by step.
Right, thats the lecture over with, lets move on to the real stuff.
Learn C# From Scratch in One Hour C# Book for Absolute Beginners with Hands On exercises and Real-World Examples the one book you need to quickly Master C# Programming, No prior experience is required
C++ Programming for Beginners: Get Started with a Multi-Paradigm Programming Language. Start Managing Data with Step-by-Step Instructions on How to Write Your First Program (2022 Guide for Newbies)