This is an old revision of the document!


Examples

Practical examples are built up in uniform style and as concrete as possible. Each example begins with a short introduction of the theory and gives necessary knowledges for completing the following practical part. Practical part contains commented example of the source code of the software. Generally the library of the HomeLab is used in the example of the code, but at some cases the registers are also configured. The first chapter is a little bit different and has a bit different goal. It describes installation and set-up of necessary software. The examples are about Windows and Linux operation systems. Chapters and practical examples after the first chapter are suitable for both OS and development software.

 

Buildup

There is a list of necessary knowledges to complete the example at each chapter of practical examples. In this list are references to other chapters of the book, which are marked with icons as follows:

  • [HW] Physical module used in th example.
  • [LIB] Part of the software library used in the example.
  • [ELC] Reference to the chapter Basics of electronics.
  • [AVR] Reference to the chapter AVR microcontroller's module.
  • [PRT] Reference to other exercises.

Basic software of the examples

As mentioned before, practical code samples are composed on the basis of the library of the HomeLab. There are most used specific AVR operations and procedures connected with the HomeLab’s modules written in the library. The usage of the library means that the user does not have to write a hardware close ??, capable for using registers?? program code to start the modules, although this opportunity exists always. Separating the software which communicates with hardware from the examples and exercises, allows the user to focus on creating his/hers own algorithm instead of peculiarities not connected to the hardware.

Code style of the examples

Näidisprogrammid on kirjutatud ühes stiilis, et programmikood oleks ülevaatlikum. Ühtne stiil teeb programmi loetavaks ja välistab kergemate süntaksivigade tekkimist. Kindlat stiili on soovitatav järgida ka harjutusülesannete tegemisel. Stiili peamised iseloomustajad:

  • Programm, selle funktsioonid ja muutujad on ingliskeelsed ning väiketähtedega, kus sõnu eraldab alakriips.
  • Funktsioonid on kujul objekt_tegevus_subjekt.
  • Olulisemad kohad programmis on kommenteeritud eesti keeles.
  • Iga C-keele plokk (tähistatud loogeliste sulgudega { ja } ) algab ja lõpeb eraldi real.
  • Plokid on tabuleeritud tabulaatorklahviga. Reasiseselt tabulaatorit ei kasutata.
en/examples.1267473298.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0