Skip to content

Commit

Permalink
en: pwm-wavelength: New file
Browse files Browse the repository at this point in the history
* src/en/sections/pwm-wavelength.tex: New file.
* src/en/sparc.tex: Use it.
* Makefile.am (SECTIONS_EN): Register it.
  • Loading branch information
artyom-poptsov committed Dec 27, 2024
1 parent ec975dc commit a6f2abd
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ SECTIONS_EN = \
src/en/sections/white-noise-serial-port.tex \
src/en/sections/white-noise-analog-ports.tex \
src/en/sections/white-noise-adc.tex \
src/en/sections/pwm-intro.tex
src/en/sections/pwm-intro.tex \
src/en/sections/pwm-wavelength.tex

SECTIONS_OUT_EN = \
$(foreach section, $(SECTIONS_EN), out/$(section))
Expand Down
36 changes: 36 additions & 0 deletions src/en/sections/pwm-wavelength.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
\documentclass[../sparc.tex]{subfiles}
\graphicspath{{\subfix{../images/}}}
\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Wavelength}

\begin{figure}[ht]
\begin{tikzpicture}
\draw[thick, ->] (0, 0) -- (12, 0) node[anchor=north west] {t};
\draw[thick, ->] (0, 0) -- (0, 7) node[anchor=south west] {V};
\draw[lightgray] (0, 0) grid (10, 6);
\foreach \x in {0, 2, ..., 8} {
\draw[ultra thick, teal] (\x, 6) -- (\x + 1, 6);
\draw[ultra thick, teal] (\x + 1, 6) -- (\x + 1, 1);
\draw[ultra thick, teal] (\x + 1, 1) -- (\x + 2, 1);
\draw[ultra thick, teal] (\x + 2, 1) -- (\x + 2, 6);
}
\end{tikzpicture}
\caption{Graphical representation of a signal in relation to the time on a
digital port.}
\label{fig:blinking-led-graph}
\end{figure}

When we programmed our ``blinking lights'' project, we supplied to a digital
port signals \texttt{HIGH} and \texttt{LOW} alternately, with a delay specified
in microseconds. If we take a look on the signal value in relation to the time
on a digital port (e.g. using an oscilloscope) we will get a graph similar to
fig. \ref{fig:blinking-led-graph}.

Where \emph{period length} is the distance between the two adjacent points in
time, where oscillations occur in the same phase. If we know the period length
we can calculate the \emph{oscillation frequency}, and vice versa -- if we know
the frequency we can calculate the wavelength.

\end{document}
2 changes: 1 addition & 1 deletion src/en/sparc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ \chapter{Pulse-Width Modulation}
\label{chapter:pwm}

\subfile{sections/pwm-intro}
\subfile{sections/pwm-wavelength}

%% TODO:
%% \subfile{sections/pwm-wavelength}
%% \subfile{sections/pwm-duty-cycle}
%% \subfile{sections/pwm-tasks}

Expand Down

0 comments on commit a6f2abd

Please sign in to comment.