% ---------------------------------------------------------------------------- %
%% \file schmittTrigger.tex
%% \author Sebastien Beaugrand
%% \sa http://beaugrand.chez.com/
%% \copyright CeCILL 2.1 Free Software license
% ---------------------------------------------------------------------------- %
\documentclass{kicad}
\usepackage{pgfplots}
\usepackage{tikz}

\begin{document}

\begin{center}
\titre{Bascule de Schmitt à transistors}
~\\
~\\
\scalebox{1.5}{\schema{schmittTrigger}}\\
~\\
\scalebox{0.9}{%
\begin{tikzpicture}
\begin{axis}[
    scale only axis,
    xmin=0, xmax=240, ymin=0, ymax=5,
    xlabel=s,
    xtick={0,30,...,240},
    ylabel=V,
    ytick={0,1,...,5},
    tick align=outside,
    legend style={at={(0.5,-0.15)},anchor=north},
    legend columns=5]
    \addplot[blue]
     table[x=Time, y=V/entree, col sep=space] {schmittTrigger940Meg.dat};
    \addplot[green]
     table[x=Time, y=V/diviseur, col sep=space] {schmittTrigger940Meg.dat};
    \addplot[red]
     table[x=Time, y=V/bascule, col sep=space] {schmittTrigger940Meg.dat};
    \addplot[black]
     table[x=Time, y=V/sortie, col sep=space] {schmittTrigger940Meg.dat};
    \legend{entree,diviseur,bascule,sortie}
\end{axis}
\end{tikzpicture}
}
\\
~\\
\begin{tabular}{|l|r@{}r|r|}\hline
Seuils pour 4\si{\volt} et 3.6\si{\volt} & & Rb1 & Rb2\\ \hline\hline
\input{thresholds940Meg.tex} & $2 \times$ & $470$ \si{\mega\ohm} & 4.7 \si{\mega\ohm}\\ \hline
\input{thresholds20Meg.tex}  & $2 \times$ & $ 10$ \si{\mega\ohm} & 100 \si{\kilo\ohm}\\ \hline
\input{thresholds200Meg.tex} & $2 \times$ & $100$ \si{\mega\ohm} &   1 \si{\mega\ohm}\\ \hline
\input{thresholds2g.tex}     & $2 \times$ & $  1$ \si{\giga\ohm} &  10 \si{\mega\ohm}\\ \hline
\end{tabular}
\vfill
\scriptsize
\copyright 2020 Sébastien Beaugrand -- CeCILL 2.1
\end{center}

\end{document}