This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:programming:c:crashcourse [2012/06/05 11:23] – eero.valjaots | en:programming:c:crashcourse [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Crash course ====== | + | ====== |
- | <note important> | + | |
===== Program structure ===== | ===== Program structure ===== | ||
Line 43: | Line 43: | ||
/* | /* | ||
- | | + | Block comment can be used to include more than one line. |
- | The beginning and the end of a comment is assigned with slash and asterisk signs. | + | The beginning and the end of a comment is assigned with slash and asterisk signs. |
*/ | */ | ||
</ | </ | ||
- | ~~PB~~ | ||
===== Data ===== | ===== Data ===== | ||
Line 141: | Line 140: | ||
</ | </ | ||
- | ~~PB~~ | + | < |
===== Operations ===== | ===== Operations ===== | ||
Line 234: | Line 233: | ||
Bit operations are essential when using the registers of microcontroller. These are described in AVR register chapter. | Bit operations are essential when using the registers of microcontroller. These are described in AVR register chapter. | ||
- | ~~PB~~ | + | < |
===== Functions ===== | ===== Functions ===== | ||
Line 273: | Line 272: | ||
The execution of a C-language program is started from //main// function which makes it compulsory function. | The execution of a C-language program is started from //main// function which makes it compulsory function. | ||
- | ~~PB~~ | + | < |
===== Statements ===== | ===== Statements ===== | ||
Line 318: | Line 317: | ||
</ | </ | ||
- | ~~PB~~ | + | < |
==== Switch statement ==== | ==== Switch statement ==== | ||
Line 370: | Line 369: | ||
</ | </ | ||
- | ~~PB~~ | + | < |
==== for loop ==== | ==== for loop ==== | ||
Line 472: | Line 471: | ||
Standard functions library (stdlib.h) includes functions to simplify different common operations and conversions. | Standard functions library (stdlib.h) includes functions to simplify different common operations and conversions. | ||
- | ==== random | + | ==== Random |
Generating a random number is not so simple for AVR microcontroller. | Generating a random number is not so simple for AVR microcontroller. | ||
Line 497: | Line 496: | ||
[[http:// | [[http:// | ||
- | ~~DISCUSSION~~ |