Skip to content

Commit 92bb310

Browse files
authored
Merge pull request #735 from Alejandro-Casanova/fix-typos-and-md-format-in-examples
Corrections for chapter 9 examples
2 parents fad4f8a + d73f97a commit 92bb310

7 files changed

Lines changed: 32 additions & 28 deletions

File tree

575 KB
Loading

examples/chapter09_07/readme.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Example Chapter09_07
2+
23
## Controlling a Seven Segment Display
34

45
Example chapter09_07 makes use of object oriented
@@ -8,20 +9,20 @@ programming methods to control a seven segment display.
89

910
In this example, port pins are used to control a
1011
seven segment single-character display. As in most other examples,
11-
both a hardware version for the target system as well as a simlulated
12+
both a hardware version for the target system as well as a simulated
1213
PC version are available. The PC version writes its
1314
character to the output console.
1415

1516
## Application Description
1617

17-
The sixteen hexadecimal digits <img src="https://render.githubusercontent.com/render/math?math=0123456789\text{AbCdEF}">
18+
The sixteen hexadecimal digits $0123456789AbCdEF$
1819
are displayed sequentially, one digit per second.
1920
The dot (_i_._e_., period or decimal point) is toggled
2021
on and off for successive groups of 16 hexadecimal digits.
2122
The user LED is simultaneously toggled at the usual $\frac{1}{2}~\text{Hz}$.
2223

2324
The application task is intuitive and easy to understand.
24-
The followind code snippet from the application task
25+
The following code snippet from the application task
2526
`app::display::task_func`, for instance, depicts the control
2627
responsible for writing the character digit and decimal
2728
point on the seven segment display. The user LED is simultaneously
@@ -70,10 +71,10 @@ portable application layer code.
7071
The screenshot below shows the PC simulation
7172
of the display application task running in a console.
7273

73-
![](./images/seven_segment.pdf)
74+
![screenshot of PC simulation](./images/seven_segment.png)
7475

7576
## Hardware Setup
7677

7778
The hardware setup is shown in the image below.
7879

79-
![](./images/board7.jpg)
80+
![hardware setup](./images/board7.jpg)

examples/chapter09_08/readme.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Example Chapter09_08
2+
23
## Controlling an RGB LED
34

45
Example chapter09_08 utilizes object oriented programming techniques
@@ -14,7 +15,7 @@ an underlying tick derived from a timer interrupt that
1415
runs every $50~{\mu}\text{s}$.
1516

1617
In this example (as in most other examples), both a hardware
17-
version for the target system as well as a simlulated PC
18+
version for the target system as well as a simulated PC
1819
version are available. For this exercise, it was
1920
decided to implement a rather detailed PC simulation
2021
using old-school traditional Win32-API programming.
@@ -30,4 +31,4 @@ The user LED is simultaneously toggled at the usual $\frac{1}{2}~\text{Hz}$.
3031
The chapter09_08 Win32-API simulation in its Windows-based
3132
application is shown in action in the image below.
3233

33-
![](./images/rgb_led_wnd_09_08.jpg)
34+
![Capture of Win32-API simulation](./images/rgb_led_wnd_09_08.jpg)

examples/chapter09_08/src/mcal/avr/mcal_led_monochrome.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
util::device::led_monochrome& mcal::led::led_monochrome0()
1414
{
15-
using local_led_mponochrome_type =
16-
mcal::led::led_momochrome_board<mcal::reg::portb, UINT8_C(5)>;
15+
using local_led_monochrome_type =
16+
mcal::led::led_monochrome_board<mcal::reg::portb, UINT8_C(5)>;
1717

18-
static local_led_mponochrome_type the_led { };
18+
static local_led_monochrome_type the_led { };
1919

2020
return the_led;
2121
}

examples/chapter09_08/src/mcal/avr/mcal_led_monochrome_board.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
{
2020
template<const std::uint8_t port_addr,
2121
const std::uint8_t port_bpos>
22-
class led_momochrome_board final : public util::device::led_monochrome
22+
class led_monochrome_board final : public util::device::led_monochrome
2323
{
2424
public:
25-
led_momochrome_board()
25+
led_monochrome_board()
2626
{
2727
// Set the port pin value to low.
2828
port_pin_type::set_pin_low();
@@ -31,7 +31,7 @@
3131
port_pin_type::set_direction_output();
3232
}
3333

34-
~led_momochrome_board() override = default;
34+
~led_monochrome_board() override = default;
3535

3636
auto my_on() -> void override
3737
{

examples/chapter09_08a/readme.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Example Chapter09_08a
2+
23
## Controlling an RGB LED of type ws2812
34

45
Example chapter09_08a utilizes object oriented programming techniques
@@ -18,7 +19,7 @@ color bits is set to the value $1$ or $0$ depending on the
1819
half-width of a low/high signal pair.
1920

2021
In this example (as in most other examples), both a hardware
21-
version for the target system as well as a simlulated PC
22+
version for the target system as well as a simulated PC
2223
version are available. For this exercise, it was
2324
decided to implement a rather detailed PC simulation
2425
using old-school traditional Win32-API programming.
@@ -52,7 +53,7 @@ These very specific mcal/microcontroller-dependent parameters
5253
are used to generate the real-time ws2812 control signal.
5354
5455
The third template parameter `LedCount` provides the ability
55-
to link multiple ws2812 devices seqentially and control them
56+
to link multiple ws2812 devices sequentially and control them
5657
in an LED chain, as is common for this particular device.
5758
5859
In example chapter09_08a, a ws2812 LED device is used.
@@ -62,7 +63,7 @@ In example chapter09_08a, a ws2812 LED device is used.
6263
The RGB-color-light-show in example chapter09_08a (this example)
6364
differs slightly from the one in example chapter09_08 (the previous example).
6465
65-
In this example the color transitions are a bit lenghtier in time
66+
In this example the color transitions are a bit lengthier in time
6667
(instead of the normal $20~\text{ms}$). Also the color transitions
6768
at and around the points $255~\text{bits}$-RGB
6869
have been lengthened in time. This results in color emphasis
@@ -76,7 +77,7 @@ This enhanced RGB-color-light-show can be found in the file
7677
The chapter09_08a Win32-API simulation in its Windows-based
7778
application is shown in action in the image below.
7879
79-
![](./images/rgb_led_wnd_09_08a.jpg)
80+
![Capture of Windows simulation](./images/rgb_led_wnd_09_08a.jpg)
8081
8182
## Hardware Setup
8283
@@ -85,23 +86,23 @@ ARDUINO(R) placed on a breadboard with soldered-on pins.
8586
The wiring is straightforward. The ws2812 port control uses port pin `portd.3`.
8687
8788
The hardware setup with the RGB LED in action is pictured
88-
in the images below. The pictures show colorful RGB hues eminating
89+
in the images below. The pictures show colorful RGB hues emanating
8990
from the bright RGB LED of type ws2812.
9091
91-
![](./images/board09_08a_01r.jpg)
92-
![](./images/board09_08a_02g.jpg)
93-
![](./images/board09_08a_03b.jpg)
92+
![Hardware setup - magenta hue emanating from LED](./images/board09_08a_01r.jpg)
93+
![Hardware setup - green hue emanating from LED](./images/board09_08a_02g.jpg)
94+
![Hardware setup - cyan hue emanating from LED](./images/board09_08a_03b.jpg)
9495
9596
### Bit Timing: ws2812
9697
9798
The approximate bit timing needed by the ws2812 is shown in the following table.
9899
99100
| Bit Value | $T_{hi}~\left[{ns}\right]$ | $T_{lo}~\left[{ns}\right]$ |
100-
| --------- | --------------- | --------------- |
101-
| $0$ | $350$ | $800$ |
102-
| $1$ | $700$ | $600$ |
101+
| --------- | -------------------------- | -------------------------- |
102+
| $0$ | $350$ | $800$ |
103+
| $1$ | $700$ | $600$ |
103104
104105
A sample partial-trace of the control signal on `portd.3` is shown
105-
below in a representation of an image from a digital oscilloscpoe.
106+
below in a representation of an image from a digital oscilloscope.
106107
107-
![](./images/ws2812_signal.jpg)
108+
![View of trace captured on digital oscilloscope](./images/ws2812_signal.jpg)

examples/chapter09_08b/readme.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Example Chapter09_08b (variation 32-bit microcontroller)
2+
23
## Controlling an RGB LED of type ws2812
34

45
Example chapter09_08b utilizes essentially the same techniques
@@ -20,7 +21,7 @@ A logic-AND gate shifts the microcontroller pin's voltage level.
2021
The microcontroller is clocked at $24~\text{MHz}$.
2122

2223
The hardware setup with the RGB LED in action is pictured
23-
in the image below. The pictures depicts a pink hue eminating
24+
in the image below. The pictures depicts a pink hue emanating
2425
from the bright RGB LED of type ws2812B.
2526

26-
![](./images/board09_08b.jpg)
27+
![Hardware setup - pink hue emanating from LED](./images/board09_08b.jpg)

0 commit comments

Comments
 (0)