{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "7aad0820-c1b8-4f10-aec4-bcf0056a67fc", "metadata": { "tags": [] }, "outputs": [], "source": [ "import matplotlib.pyplot as plt \n", "from IPython.display import display, HTML\n", "\n", "def recherche_front_montant(t, E):\n", " for i in range(len(E)-1):\n", " if (int(E[i+1]) == 1 ) and (int(E[i]) == 0 ):\n", " m_t = (t[i] + t[i+1]) / 2\n", " return m_t\n", " return None\n", "\n", "def recherche_front_descendant(t, E):\n", " for i in range(len(E)-1):\n", " if (int(E[i+1]) == 0 ) and (int(E[i]) == 1 ):\n", " m_t = (t[i] + t[i+1]) / 2\n", " return m_t\n", " return None" ] }, { "cell_type": "markdown", "id": "110461b9-5c53-4870-a8e6-7569c1caf7d4", "metadata": {}, "source": [ "## Mesures temporelles - Durée de parcours d'une onde ultrasonore\n", "\n", "Lorsque l'utilisateur clique sur le bouton `Mesure` le programme :\n", " - envoie la commande `mesure` à la carte _Arduino_,\n", " - reçoit des données sur la liaison série et les affiche sous forme de graphe $E=f(t)$." ] }, { "cell_type": "code", "execution_count": 1, "id": "169afeb4-ad18-4700-9ae5-cebab85262ee", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "\n", "\t\n", "\t\n", "\t
\n", "\t \n", "\t \n", "\t \n", "\t\n", "\t\n", "\t\n", "\t\n", "\t \n", "\t \n", "\t \n", "\t \n", "\t\n", "\t\n", "\t\n", "\n", "\t" ], "text/plain": [ "