add wiring images
parent
8e99d28423
commit
59aaad4152
|
|
@ -2,7 +2,7 @@
|
|||
%Necessary Information
|
||||
\author[C\&F]{Clemens, Franz}
|
||||
\title{IoT Night}
|
||||
\subtitle{ESP8266 \& parts}
|
||||
\subtitle{S stands for security}
|
||||
%The day of the presentation
|
||||
\date{\today}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,4 +6,12 @@
|
|||
}
|
||||
@misc{micropython-doc,
|
||||
url={https://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/intro.html}
|
||||
}
|
||||
}
|
||||
@misc{node-dht,
|
||||
url={https://www.mikrocontroller.net/topic/389850}}
|
||||
@misc{node-led,
|
||||
url={https://www.pinterest.de/pin/658088564269958262/}}
|
||||
@misc{node-button,
|
||||
url={https://alexbloggt.com/esp8266-pushover/}}
|
||||
@misc{mp-interrupt,
|
||||
url={{https://docs.micropython.org/en/latest/esp8266/reference/isr_rules.html}}}
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 106 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 122 KiB |
|
|
@ -187,14 +187,13 @@ Windows:
|
|||
\item 115200 Baud
|
||||
\item $n$ beherzte \textit{<ENTER>}-Drücke
|
||||
\end{itemize}
|
||||
%TODO: bild mit REPL (inkl ENTERs)
|
||||
\end{frame}
|
||||
|
||||
\lstset{language=Python,captionpos=b}
|
||||
|
||||
\begin{frame}{REPL}
|
||||
\framesubtitle{Hello World!}
|
||||
%TODO: bild
|
||||
%TODO: bild mit REPL (inkl ENTERs)
|
||||
\end{frame}
|
||||
|
||||
|
||||
|
|
@ -220,13 +219,17 @@ import webrepl_setup
|
|||
\end{lstlisting}
|
||||
\begin{itemize}
|
||||
\item \textit{import webrepl\_setup}
|
||||
\item reset/start webrepl (import webrepl \& webrepl.start())
|
||||
\item reset/start webrepl (\textit{import webrepl \& webrepl.start()})
|
||||
\item visit \url{http://iot.wiai/webrepl/} or \url{http://micropython.org/webrepl/}
|
||||
\item enter your ESP's IP (\textit{sta\_if.ifconfig()}) \& connect
|
||||
\end{itemize}
|
||||
\end{frame}
|
||||
|
||||
\subsection{Init}
|
||||
\begin{frame}{main.py}
|
||||
|
||||
\end{frame}
|
||||
|
||||
\subsection{Exkurs: Flask-Server}
|
||||
\begin{frame}[fragile]{Gegenseite: Flask}
|
||||
\begin{lstlisting}[caption={C\&C Server},label=cnc]
|
||||
|
|
@ -243,8 +246,8 @@ Starten:
|
|||
\begin{itemize}
|
||||
\item[!] pip install Flask
|
||||
\item python server.py
|
||||
\item docker-compose up (server.py in src/)
|
||||
\item FLASK\_APP=server.py flask run
|
||||
\item[||] docker-compose up (server.py in src/)
|
||||
\item[||] FLASK\_APP=server.py flask run
|
||||
\end{itemize}
|
||||
\end{frame}
|
||||
\begin{frame}[fragile]{Daten übertragen}
|
||||
|
|
@ -267,19 +270,20 @@ urequests.post(post_url, data=data, headers=json_header)
|
|||
\section{Basteln}
|
||||
\subsection{Blinkende LED}
|
||||
\begin{frame}{LED anschließen}
|
||||
TODO schema
|
||||
\image{.4\textwidth}{node-led}{LED \cite{node-led}}{img:led}
|
||||
\end{frame}
|
||||
\begin{frame}[fragile]{LEDs}
|
||||
\begin{lstlisting}[caption={LED},label=led]
|
||||
\setbeamercovered{invisible}
|
||||
\begin{lstlisting}[caption={LED},label=led,escapeinside={(*@}{@*)}]
|
||||
import machine, time, math
|
||||
pin = machine.Pin(0, machine.Pin.OUT)
|
||||
pin.on()
|
||||
pin.off()
|
||||
|
||||
(*@\onslide<2->@*)
|
||||
pwm = machine.PWM(pin)
|
||||
pwm.duty(512)
|
||||
pwm.deinit()
|
||||
|
||||
(*@\onslide<3->@*)
|
||||
def pulse(l, t):
|
||||
for i in range(20):
|
||||
l.duty(int(math.sin(i / 10 * math.pi) * 500 + 500))
|
||||
|
|
@ -289,24 +293,23 @@ pulse(led, 50)
|
|||
for i in range(10):
|
||||
pulse(led, 20)
|
||||
\end{lstlisting}
|
||||
|
||||
\end{frame}
|
||||
\subsection{Schalter und Taster}
|
||||
\begin{frame}[fragile]{Input}
|
||||
TODO: schema
|
||||
\image{.35\textwidth}{button-nodemcu}{Taster \cite{node-button}}{img:button}
|
||||
\begin{lstlisting}[caption={Input},label=input]
|
||||
import machine
|
||||
pin = machine.Pin(0, machine.Pin.IN, machine.Pin.PULL_UP)
|
||||
status = pin.value()
|
||||
|
||||
# status = pin.value()
|
||||
def callback(p):
|
||||
print('changed', p)
|
||||
|
||||
pin.irq(trigger=machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING, handler=callback)
|
||||
\end{lstlisting}
|
||||
\end{frame}
|
||||
\subsection{Sensoren}
|
||||
\begin{frame}[fragile]{Sensoren}
|
||||
TODO: schema
|
||||
\image{.35\textwidth}{nodemcu-dht22}{DHT22 \cite{node-dht}}{img:dht}
|
||||
\begin{lstlisting}[caption={Sensoren},label=senors]
|
||||
import dht
|
||||
import machine
|
||||
|
|
@ -317,6 +320,17 @@ d.humidity()
|
|||
\end{lstlisting}
|
||||
\end{frame}
|
||||
|
||||
\subsection{Interrupts}
|
||||
\begin{frame}{Here be dragons}
|
||||
\begin{itemize}
|
||||
\item Z.B. Callbacks von Tastern
|
||||
\item pausieren main
|
||||
\item dürf
|
||||
\item Emergency exception buffer: \textit{micropython.alloc\_emergency\_exception\_buf(100)}
|
||||
\item
|
||||
\end{itemize}
|
||||
\cite{mp-interrupt}
|
||||
\end{frame}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%%%%%%%%% References %%%%%%%%%%
|
||||
|
|
|
|||
Loading…
Reference in New Issue