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
#define Rouge A0 | |
#define Vert A1 | |
#define Bleu A2 | |
int message = 0; | |
int couleurs[] = {Rouge, Vert, Bleu}; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(Rouge, OUTPUT); |
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 de la librairie serial | |
import serial | |
# Ouverture du port serie avec : | |
# '/dev/ttyXXXX' : definition du port d ecoute (remplacer 'X' par le bon nom) | |
# 9600 : vitesse de communication | |
serialArduino = serial.Serial('/dev/ttyXXXX', 9600) | |
# Ecriture de chaque message recu |
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
int i=0; | |
void setup() { | |
Serial.begin(9600); | |
Serial.println("Un message va etre envoye toutes les deux secondes des maintenant !"); | |
} | |
void loop() { | |
Serial.println("Message #" + String(i)); | |
delay(2000); |
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
import RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(17, GPIO.OUT) | |
GPIO.setwarnings(False) | |
ajoutAngle = 5 | |
print("\n+----------/ ServoMoteur Controlleur /----------+") |
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) | |
print "+-----------------------------------------------------------+" | |
print "| Mesure de distance par le capteur ultrasonore HC-SR04 |" | |
print "+-----------------------------------------------------------+" | |
Trig = 23 # Entree Trig du HC-SR04 branchee au GPIO 23 |
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
def fichierVersListe(cheminFich): | |
f = open(cheminFich, "r") | |
points=[] | |
temperatures=[] | |
for line in f: | |
points.append([line[0:2], line[3:5], line[6:len(line) - 1]]) | |
temperatures.append(float(line[6:len(line) - 1])) | |
f.close() | |
return [points, temperatures] |
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
#Ajouter les imports suivants en debut de fichier | |
from datetime import datetime, timedelta | |
import os | |
# Entree : temperature; Fonction : enregistrer la temperature dans un fichier, au bon endroit | |
def enregistrement(temperature): | |
d = datetime.now() | |
# On recupere de datetime.now l'annee & le jour et on le stocke | |
annee = str(d)[:4] | |
jour = str(d)[:10] |
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
body { | |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; | |
background-color: #F5F5F5; | |
} | |
h1 { | |
font-size: 4.5rem; | |
font-weight: 300; | |
margin: 0 0 0 0; | |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; |