This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from flask import Flask, render_template | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setwarnings(False) | |
app = Flask(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
def lire_fichier (emplacement) : | |
fichier = open(emplacement) | |
contenu = fichier.read() | |
fichier.close() | |
return contenu | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import time | |
import datetime | |
def lire_fichier (emplacement) : | |
fichier = open(emplacement) | |
contenu = fichier.read() | |
fichier.close() | |
return contenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
def lire_fichier (emplacement) : | |
# Ouverture du fichier contenant la temperature | |
fichier = open(emplacement) | |
# Lecture du fichier | |
contenu = fichier.read() | |
# Fermeture du fichier apres qu'il ai ete lu | |
fichier.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from flask import Flask, render_template | |
import RPi.GPIO as GPIO | |
from datetime import datetime, timedelta | |
import os | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setwarnings(False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"> | |
<meta content="utf-8" http-equiv="encoding"> | |
<link rel = "icon" type = "image/png" href = "https://raspberry-lab.fr/ImgStat/Icon.png" /> | |
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}" /> | |
<title>Temperature</title> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return 'Hello world !' | |
app.run(debug=True, host='0.0.0.0', port=5000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return render_template('index.html', nomSite = 'Raspberry Lab') | |
app.run(debug=True, host='0.0.0.0', port=5000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
capteur = 7 | |
GPIO.setup(capteur, GPIO.IN) | |
print "Demarrage du capteur" | |
time.sleep(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from RPLCD.gpio import CharLCD | |
import time | |
lcd = CharLCD(cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33, 31, 29, 23]) | |
while True : | |
lcd.write_string(u'Espace Raspberry') | |
time.sleep(2) | |
lcd.clear() | |
time.sleep(1) |
NewerOlder