Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8917b9aac6 | ||
|
ba9513a33e | ||
|
10830c0bb6 | ||
|
de4bf1391f | ||
|
60ecc2d705 | ||
|
e1ac8e5ec7 | ||
|
4ba2ffa7e6 | ||
|
6f660396fc | ||
|
1073558050 | ||
|
ebde2e0206 |
@@ -1,13 +1,12 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#define WindSensorPin (2)
|
||||||
#define WindSensorPin (2) // The pin location of the anemometer sensor
|
|
||||||
|
|
||||||
volatile unsigned long Rotations; // cup rotation counter used in interrupt routine
|
volatile unsigned long Rotations; // cup rotation counter used in interrupt routine
|
||||||
volatile unsigned long ContactBounceTime; // Timer to avoid contact bounce in interrupt routine
|
volatile unsigned long ContactBounceTime; // Timer to avoid contact bounce in interrupt routine
|
||||||
|
|
||||||
float WindSpeed; // speed miles per hour
|
float WindSpeed; // speed miles per hour
|
||||||
|
|
||||||
void setup() {
|
void setup()
|
||||||
|
{
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
|
||||||
pinMode(WindSensorPin, INPUT);
|
pinMode(WindSensorPin, INPUT);
|
||||||
@@ -16,8 +15,8 @@ attachInterrupt(digitalPinToInterrupt(WindSensorPin), isr_rotation, FALLING);
|
|||||||
Serial.println("Rotations\tKm/h");
|
Serial.println("Rotations\tKm/h");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop()
|
||||||
|
{
|
||||||
Rotations = 0; // Set Rotations count to 0 ready for calculations
|
Rotations = 0; // Set Rotations count to 0 ready for calculations
|
||||||
|
|
||||||
sei(); // Enables interrupts
|
sei(); // Enables interrupts
|
||||||
@@ -31,15 +30,14 @@ WindSpeed = (Rotations * 0.75) * 1.609344;
|
|||||||
|
|
||||||
Serial.print(Rotations); Serial.print("\t\t");
|
Serial.print(Rotations); Serial.print("\t\t");
|
||||||
Serial.println(WindSpeed);
|
Serial.println(WindSpeed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is the function that the interrupt calls to increment the rotation count
|
// This is the function that the interrupt calls to increment the rotation count
|
||||||
void isr_rotation () {
|
void isr_rotation()
|
||||||
|
{
|
||||||
if ((millis() - ContactBounceTime) > 15 ) { // debounce the switch contact.
|
if ((millis() - ContactBounceTime) > 15 ) // debounce the switch contact.
|
||||||
|
{
|
||||||
Rotations++;
|
Rotations++;
|
||||||
ContactBounceTime = millis();
|
ContactBounceTime = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -3,17 +3,25 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <Servo.h>
|
#include <Servo.h>
|
||||||
#define WindSensorPin (2)
|
#define WindSensorPin (2)
|
||||||
|
|
||||||
|
|
||||||
volatile unsigned long Rotations;
|
volatile unsigned long Rotations;
|
||||||
volatile unsigned long ContactBounceTime;
|
volatile unsigned long ContactBounceTime;
|
||||||
|
|
||||||
|
unsigned long duration;
|
||||||
|
|
||||||
float WindSpeed;
|
float WindSpeed;
|
||||||
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0xD4, 0x22 };// @dresse MAC de votre Arduino Ethernet
|
float T = 0;
|
||||||
|
|
||||||
|
byte mac[] = {0x90, 0xA2, 0xDA, 0x0E, 0xD4, 0x22}; // @Arduino Ethernet
|
||||||
byte ip[] = {10, 66, 240, 59};
|
byte ip[] = {10, 66, 240, 59};
|
||||||
//char server[] = "spe.sin.apo.free.fr"; // nom du site
|
|
||||||
char server[] = "10.66.240.81"; // @PC en local quand on utilise WAMPSERVEUR
|
char server[] = "10.66.240.81"; // @PC
|
||||||
|
|
||||||
String readString;
|
String readString;
|
||||||
Servo monServomoteur;
|
|
||||||
boolean drapeau = false;
|
boolean drapeau = false;
|
||||||
|
|
||||||
|
|
||||||
int D;
|
int D;
|
||||||
int LE;
|
int LE;
|
||||||
int LI;
|
int LI;
|
||||||
@@ -21,9 +29,8 @@ int S;
|
|||||||
int AM;
|
int AM;
|
||||||
char c;
|
char c;
|
||||||
int pin = 9;
|
int pin = 9;
|
||||||
unsigned long duration;
|
|
||||||
int position = 0;
|
int position = 0;
|
||||||
float T = 0;
|
|
||||||
int F = 1 / T;
|
int F = 1 / T;
|
||||||
int Led = 7;
|
int Led = 7;
|
||||||
int bLed = 3;
|
int bLed = 3;
|
||||||
@@ -33,8 +40,8 @@ int ST;
|
|||||||
|
|
||||||
EthernetClient client;
|
EthernetClient client;
|
||||||
|
|
||||||
|
void setup()
|
||||||
void setup() {
|
{
|
||||||
pinMode(pin, INPUT);
|
pinMode(pin, INPUT);
|
||||||
pinMode(bLed, OUTPUT);
|
pinMode(bLed, OUTPUT);
|
||||||
pinMode(gLed, OUTPUT);
|
pinMode(gLed, OUTPUT);
|
||||||
@@ -43,15 +50,19 @@ void setup() {
|
|||||||
monServomoteur.attach(8);
|
monServomoteur.attach(8);
|
||||||
Serial.begin(9600); // mise en marche liaison série
|
Serial.begin(9600); // mise en marche liaison série
|
||||||
//Ethernet.begin(mac, ip);
|
//Ethernet.begin(mac, ip);
|
||||||
if (Ethernet.begin(mac) == 0) {
|
if (Ethernet.begin(mac) == 0)
|
||||||
|
{
|
||||||
Serial.println("Failed to configure Ethernet using DHCP");
|
Serial.println("Failed to configure Ethernet using DHCP");
|
||||||
// no point in carrying on, so do nothing forevermore:
|
// no point in carrying on, so do nothing forevermore:
|
||||||
for(;;);}
|
for (;;)
|
||||||
|
;
|
||||||
|
}
|
||||||
delay(2000);
|
delay(2000);
|
||||||
Serial.println("connecting...");
|
Serial.println("connecting...");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop(){
|
void loop()
|
||||||
|
{
|
||||||
//Luxmetre
|
//Luxmetre
|
||||||
delay(500);
|
delay(500);
|
||||||
duration = pulseIn(pin, HIGH);
|
duration = pulseIn(pin, HIGH);
|
||||||
@@ -65,23 +76,29 @@ sei();
|
|||||||
delay(3000);
|
delay(3000);
|
||||||
cli();
|
cli();
|
||||||
WindSpeed = (Rotations * 0.75) * 1.609344;
|
WindSpeed = (Rotations * 0.75) * 1.609344;
|
||||||
Serial.print(Rotations); Serial.print("\t\t");
|
Serial.print(Rotations);
|
||||||
|
Serial.print("\t\t");
|
||||||
Serial.println(WindSpeed);
|
Serial.println(WindSpeed);
|
||||||
|
|
||||||
envoieBDD();
|
envoieBDD();
|
||||||
LectureBDD();
|
LectureBDD();
|
||||||
Traitement();
|
Traitement();
|
||||||
}
|
}
|
||||||
void isr_rotation () {
|
|
||||||
|
|
||||||
if ((millis() - ContactBounceTime) > 15 ) { // debounce the switch contact.
|
void isr_rotation()
|
||||||
|
{
|
||||||
|
|
||||||
|
if ((millis() - ContactBounceTime) > 15)
|
||||||
|
{ // debounce the switch contact.
|
||||||
Rotations++;
|
Rotations++;
|
||||||
ContactBounceTime = millis();
|
ContactBounceTime = millis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void envoieBDD()
|
void envoieBDD()
|
||||||
{
|
{
|
||||||
if (client.connect(server, 80)) {
|
if (client.connect(server, 80))
|
||||||
|
{
|
||||||
Serial.println("connected");
|
Serial.println("connected");
|
||||||
client.print("GET /SLEGPI/ecriture.php?lux=");
|
client.print("GET /SLEGPI/ecriture.php?lux=");
|
||||||
client.print(F);
|
client.print(F);
|
||||||
@@ -93,11 +110,13 @@ void envoieBDD()
|
|||||||
client.stop();
|
client.stop();
|
||||||
client.println();
|
client.println();
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
Serial.println("connection failed");
|
Serial.println("connection failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client.connect(server, 80)) {
|
if (client.connect(server, 80))
|
||||||
|
{
|
||||||
Serial.println("connected");
|
Serial.println("connected");
|
||||||
client.print("GET /SLEGPI/ecriture.php?vent=");
|
client.print("GET /SLEGPI/ecriture.php?vent=");
|
||||||
client.print(WindSpeed);
|
client.print(WindSpeed);
|
||||||
@@ -109,10 +128,10 @@ void envoieBDD()
|
|||||||
client.stop();
|
client.stop();
|
||||||
client.println();
|
client.println();
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
Serial.println("connection failed");
|
Serial.println("connection failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LectureBDD()
|
void LectureBDD()
|
||||||
@@ -130,7 +149,8 @@ EthernetClient client = server.available();
|
|||||||
{
|
{
|
||||||
char c = client.read(); //lecture caractère par caractère
|
char c = client.read(); //lecture caractère par caractère
|
||||||
//on concatène les caractères et on ne sélectionne qu'un string total de longueur < 40
|
//on concatène les caractères et on ne sélectionne qu'un string total de longueur < 40
|
||||||
if (readString.length()<40 ) readString.concat(c);
|
if (readString.length() < 40)
|
||||||
|
readString.concat(c);
|
||||||
// détection de fin de ligne
|
// détection de fin de ligne
|
||||||
if (c == '\n')
|
if (c == '\n')
|
||||||
{
|
{
|
||||||
@@ -144,8 +164,6 @@ EthernetClient client = server.available();
|
|||||||
readString = ""; //initialisation de la variable chaîne readString
|
readString = ""; //initialisation de la variable chaîne readString
|
||||||
client.stop(); //deconnection de l'arduino
|
client.stop(); //deconnection de l'arduino
|
||||||
Serial.println();
|
Serial.println();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -154,10 +172,12 @@ EthernetClient client = server.available();
|
|||||||
|
|
||||||
void Traitement()
|
void Traitement()
|
||||||
{
|
{
|
||||||
if(AM >0){
|
if (AM > 0)
|
||||||
|
{
|
||||||
Serial.println("Mode automatique");
|
Serial.println("Mode automatique");
|
||||||
|
|
||||||
if(F <1000){
|
if (F < 1000)
|
||||||
|
{
|
||||||
digitalWrite(bLed, HIGH);
|
digitalWrite(bLed, HIGH);
|
||||||
digitalWrite(gLed, HIGH);
|
digitalWrite(gLed, HIGH);
|
||||||
digitalWrite(rLed, HIGH);
|
digitalWrite(rLed, HIGH);
|
||||||
@@ -173,7 +193,8 @@ void Traitement()
|
|||||||
ST = 0;
|
ST = 0;
|
||||||
//allumer
|
//allumer
|
||||||
|
|
||||||
if (client.connect(server, 80)) {
|
if (client.connect(server, 80))
|
||||||
|
{
|
||||||
Serial.println("connected");
|
Serial.println("connected");
|
||||||
Serial.println("toto");
|
Serial.println("toto");
|
||||||
client.print("GET /SLEGPI/ecriture.php?eInt=");
|
client.print("GET /SLEGPI/ecriture.php?eInt=");
|
||||||
@@ -187,10 +208,12 @@ if (client.connect(server, 80)) {
|
|||||||
client.stop();
|
client.stop();
|
||||||
client.println();
|
client.println();
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
Serial.println("connection failed");
|
Serial.println("connection failed");
|
||||||
}
|
}
|
||||||
if (client.connect(server, 80)) {
|
if (client.connect(server, 80))
|
||||||
|
{
|
||||||
Serial.println("connected");
|
Serial.println("connected");
|
||||||
client.print("GET /SLEGPI/ecriture.php?eExt=");
|
client.print("GET /SLEGPI/ecriture.php?eExt=");
|
||||||
client.print(D);
|
client.print(D);
|
||||||
@@ -202,7 +225,8 @@ if (client.connect(server, 80)) {
|
|||||||
client.stop();
|
client.stop();
|
||||||
client.println();
|
client.println();
|
||||||
}
|
}
|
||||||
if (client.connect(server, 80)) {
|
if (client.connect(server, 80))
|
||||||
|
{
|
||||||
Serial.println("connected");
|
Serial.println("connected");
|
||||||
client.print("GET /SLEGPI/ecriture.php?Store=");
|
client.print("GET /SLEGPI/ecriture.php?Store=");
|
||||||
client.print(ST);
|
client.print(ST);
|
||||||
@@ -216,9 +240,8 @@ if (client.connect(server, 80)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (F > 1000)
|
||||||
|
{
|
||||||
if(F >1000){
|
|
||||||
digitalWrite(bLed, LOW);
|
digitalWrite(bLed, LOW);
|
||||||
digitalWrite(gLed, LOW);
|
digitalWrite(gLed, LOW);
|
||||||
digitalWrite(rLed, LOW);
|
digitalWrite(rLed, LOW);
|
||||||
@@ -235,7 +258,8 @@ if (client.connect(server, 80)) {
|
|||||||
D = 0;
|
D = 0;
|
||||||
ST = 1;
|
ST = 1;
|
||||||
//et
|
//et
|
||||||
if (client.connect(server, 80)) {
|
if (client.connect(server, 80))
|
||||||
|
{
|
||||||
Serial.println("connected");
|
Serial.println("connected");
|
||||||
Serial.println("toto");
|
Serial.println("toto");
|
||||||
client.print("GET /SLEGPI/ecriture.php?eInt=");
|
client.print("GET /SLEGPI/ecriture.php?eInt=");
|
||||||
@@ -249,10 +273,12 @@ if (client.connect(server, 80)) {
|
|||||||
client.stop();
|
client.stop();
|
||||||
client.println();
|
client.println();
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
Serial.println("connection failed");
|
Serial.println("connection failed");
|
||||||
}
|
}
|
||||||
if (client.connect(server, 80)) {
|
if (client.connect(server, 80))
|
||||||
|
{
|
||||||
Serial.println("connected");
|
Serial.println("connected");
|
||||||
client.print("GET /SLEGPI/ecriture.php?eExt=");
|
client.print("GET /SLEGPI/ecriture.php?eExt=");
|
||||||
client.print(D);
|
client.print(D);
|
||||||
@@ -264,7 +290,8 @@ if (client.connect(server, 80)) {
|
|||||||
client.stop();
|
client.stop();
|
||||||
client.println();
|
client.println();
|
||||||
}
|
}
|
||||||
if (client.connect(server, 80)) {
|
if (client.connect(server, 80))
|
||||||
|
{
|
||||||
Serial.println("connected");
|
Serial.println("connected");
|
||||||
Serial.println("toto");
|
Serial.println("toto");
|
||||||
client.print("GET /SLEGPI/ecriture.php?Store=");
|
client.print("GET /SLEGPI/ecriture.php?Store=");
|
||||||
@@ -280,35 +307,35 @@ if (client.connect(server, 80)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //Allumer les lumieres exterieurs
|
} //Allumer les lumieres exterieurs
|
||||||
else{
|
else
|
||||||
|
{
|
||||||
Serial.println("Mode manuel");
|
Serial.println("Mode manuel");
|
||||||
//Eteindre les lumieres exterieurs
|
//Eteindre les lumieres exterieurs
|
||||||
|
|
||||||
|
if (LI > 0)
|
||||||
|
{
|
||||||
if(LI >0){
|
|
||||||
digitalWrite(Led, LOW);
|
digitalWrite(Led, LOW);
|
||||||
} //Allumer les lumieres exterieurs
|
} //Allumer les lumieres exterieurs
|
||||||
else{
|
else
|
||||||
|
{
|
||||||
digitalWrite(Led, HIGH);
|
digitalWrite(Led, HIGH);
|
||||||
} //Eteindre les lumieres exterieurs
|
} //Eteindre les lumieres exterieurs
|
||||||
|
|
||||||
|
if (LE > 0)
|
||||||
|
{
|
||||||
if(LE >0){
|
|
||||||
digitalWrite(bLed, HIGH);
|
digitalWrite(bLed, HIGH);
|
||||||
digitalWrite(gLed, HIGH);
|
digitalWrite(gLed, HIGH);
|
||||||
digitalWrite(rLed, HIGH);
|
digitalWrite(rLed, HIGH);
|
||||||
} //Allumer les lumieres exterieurs
|
} //Allumer les lumieres exterieurs
|
||||||
else{
|
else
|
||||||
|
{
|
||||||
digitalWrite(bLed, LOW);
|
digitalWrite(bLed, LOW);
|
||||||
digitalWrite(gLed, LOW);
|
digitalWrite(gLed, LOW);
|
||||||
digitalWrite(rLed, LOW);
|
digitalWrite(rLed, LOW);
|
||||||
} //Eteindre les lumieres exterieurs
|
} //Eteindre les lumieres exterieurs
|
||||||
|
|
||||||
|
if (S > 0)
|
||||||
|
{
|
||||||
if(S >0){
|
|
||||||
if (drapeau == false)
|
if (drapeau == false)
|
||||||
{
|
{
|
||||||
drapeau = true;
|
drapeau = true;
|
||||||
@@ -318,10 +345,10 @@ if (client.connect(server, 80)) {
|
|||||||
delay(15);
|
delay(15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//Monter le Store
|
//Monter le Store
|
||||||
else{
|
else
|
||||||
|
{
|
||||||
|
|
||||||
if (drapeau == true)
|
if (drapeau == true)
|
||||||
{
|
{
|
||||||
@@ -332,32 +359,4 @@ if (client.connect(server, 80)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //Baisser le Store
|
} //Baisser le Store
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,17 +1,14 @@
|
|||||||
int pin = 10;
|
|
||||||
unsigned long duration;
|
unsigned long duration;
|
||||||
float T = 0;
|
float T = 0;
|
||||||
|
|
||||||
|
int pin = 10;
|
||||||
int F = 1/T;
|
int F = 1/T;
|
||||||
int led = 9;
|
int led = 9;
|
||||||
int BLUE = 6;
|
int BLUE = 6;
|
||||||
int GREEN = 3;
|
int GREEN = 3;
|
||||||
int RED = 5;
|
int RED = 5;
|
||||||
int brightness1 = 200;
|
int lum1 = 255;
|
||||||
int brightness2 = 255;
|
int lum0 = 0;
|
||||||
int brightness3 = 255;
|
|
||||||
int brightness4 = 0;
|
|
||||||
int brightness5 = 0;
|
|
||||||
int brightness6 = 0;
|
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
@@ -33,16 +30,15 @@ Serial.println(F, DEC);
|
|||||||
if (F >= 500)
|
if (F >= 500)
|
||||||
{
|
{
|
||||||
digitalWrite(led, HIGH);
|
digitalWrite(led, HIGH);
|
||||||
analogWrite(RED, brightness4);
|
analogWrite(RED, lum0);
|
||||||
analogWrite(GREEN, brightness5);
|
analogWrite(GREEN, lum0);
|
||||||
analogWrite(BLUE, brightness6);
|
analogWrite(BLUE, lum0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
digitalWrite(led, LOW);
|
digitalWrite(led, LOW);
|
||||||
analogWrite(RED, brightness1);
|
analogWrite(RED, lum1);
|
||||||
analogWrite(GREEN, brightness2);
|
analogWrite(GREEN, lum1);
|
||||||
analogWrite(BLUE, brightness3);
|
analogWrite(BLUE, lum1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,12 +2,16 @@
|
|||||||
#include <Ethernet.h>
|
#include <Ethernet.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#define WindSensorPin (2)
|
#define WindSensorPin (2)
|
||||||
|
|
||||||
|
|
||||||
volatile unsigned long Rotations;
|
volatile unsigned long Rotations;
|
||||||
volatile unsigned long ContactBounceTime;
|
volatile unsigned long ContactBounceTime;
|
||||||
float WindSpeed;
|
float WindSpeed;
|
||||||
int pin = 9;
|
|
||||||
unsigned long duration;
|
unsigned long duration;
|
||||||
float T = 0;
|
float T = 0;
|
||||||
|
|
||||||
|
int pin = 9;
|
||||||
int F = 1/T;
|
int F = 1/T;
|
||||||
int led = 8;
|
int led = 8;
|
||||||
int BLUE = 6;
|
int BLUE = 6;
|
||||||
@@ -19,12 +23,15 @@ int brightness3 = 255;
|
|||||||
int brightness4 = 0;
|
int brightness4 = 0;
|
||||||
int brightness5 = 0;
|
int brightness5 = 0;
|
||||||
int brightness6 = 0;
|
int brightness6 = 0;
|
||||||
|
|
||||||
EthernetClient client;
|
EthernetClient client;
|
||||||
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0xD4, 0x22 };
|
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0E, 0xD4, 0x22 };
|
||||||
byte ip[] = { 192, 168, 1, 102 }; //ip arduino
|
byte ip[] = { 192, 168, 1, 102 }; //ip arduino
|
||||||
|
|
||||||
char server[] = "192.168.1.101"; //ip raspberry
|
char server[] = "192.168.1.101"; //ip raspberry
|
||||||
|
|
||||||
void setup() {
|
void setup()
|
||||||
|
{
|
||||||
|
|
||||||
pinMode(WindSensorPin, INPUT);
|
pinMode(WindSensorPin, INPUT);
|
||||||
attachInterrupt(digitalPinToInterrupt(WindSensorPin), isr_rotation, FALLING);
|
attachInterrupt(digitalPinToInterrupt(WindSensorPin), isr_rotation, FALLING);
|
||||||
@@ -36,7 +43,8 @@ Serial.println("Rotations\tKm/h");
|
|||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
digitalWrite(led, LOW);
|
digitalWrite(led, LOW);
|
||||||
|
|
||||||
if (Ethernet.begin(mac) == 0) {
|
if (Ethernet.begin(mac) == 0)
|
||||||
|
{
|
||||||
Serial.println("Failed to configure Ethernet using DHCP");
|
Serial.println("Failed to configure Ethernet using DHCP");
|
||||||
for (;;)
|
for (;;)
|
||||||
;
|
;
|
||||||
@@ -45,7 +53,8 @@ Serial.println("Rotations\tKm/h");
|
|||||||
Serial.println("connecting...");
|
Serial.println("connecting...");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop()
|
||||||
|
{
|
||||||
|
|
||||||
//luxmetre
|
//luxmetre
|
||||||
delay(500);
|
delay(500);
|
||||||
@@ -69,7 +78,8 @@ else
|
|||||||
analogWrite(BLUE, brightness3);
|
analogWrite(BLUE, brightness3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client.connect(server, 80)) {
|
if (client.connect(server, 80))
|
||||||
|
{
|
||||||
Serial.println("connected");
|
Serial.println("connected");
|
||||||
client.print("GET /SLEGPI/ecriture.php?lux=");
|
client.print("GET /SLEGPI/ecriture.php?lux=");
|
||||||
client.print(F);
|
client.print(F);
|
||||||
@@ -81,7 +91,8 @@ else
|
|||||||
client.stop();
|
client.stop();
|
||||||
client.println();
|
client.println();
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
Serial.println("connection failed");
|
Serial.println("connection failed");
|
||||||
}
|
}
|
||||||
delay(500);
|
delay(500);
|
||||||
@@ -92,10 +103,12 @@ sei();
|
|||||||
delay(3000);
|
delay(3000);
|
||||||
cli();
|
cli();
|
||||||
WindSpeed = (Rotations * 0.75) * 1.609344;
|
WindSpeed = (Rotations * 0.75) * 1.609344;
|
||||||
Serial.print(Rotations); Serial.print("\t\t");
|
Serial.print(Rotations);
|
||||||
|
Serial.print("\t\t");
|
||||||
Serial.println(WindSpeed);
|
Serial.println(WindSpeed);
|
||||||
|
|
||||||
if (client.connect(server, 80)) {
|
if (client.connect(server, 80))
|
||||||
|
{
|
||||||
Serial.println("connected");
|
Serial.println("connected");
|
||||||
client.print("GET /SLEGPI/ecriture.php?vent=");
|
client.print("GET /SLEGPI/ecriture.php?vent=");
|
||||||
client.print(WindSpeed);
|
client.print(WindSpeed);
|
||||||
@@ -107,13 +120,15 @@ Serial.println(WindSpeed);
|
|||||||
client.stop();
|
client.stop();
|
||||||
client.println();
|
client.println();
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
Serial.println("connection failed");
|
Serial.println("connection failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void isr_rotation () {
|
void isr_rotation ()
|
||||||
|
{
|
||||||
if ((millis() - ContactBounceTime) > 15 ) { // debounce the switch contact.
|
if ((millis() - ContactBounceTime) > 15)
|
||||||
|
{ // debounce the switch contact.
|
||||||
Rotations++;
|
Rotations++;
|
||||||
ContactBounceTime = millis();
|
ContactBounceTime = millis();
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +1,14 @@
|
|||||||
|
unsigned long duration;
|
||||||
|
float T = 0;
|
||||||
|
|
||||||
int bLed = 3;
|
int bLed = 3;
|
||||||
int gLed = 4;
|
int gLed = 4;
|
||||||
int rLed = 6;
|
int rLed = 6;
|
||||||
int pin = 9;
|
int pin = 9;
|
||||||
unsigned long duration;
|
|
||||||
float T = 0;
|
|
||||||
int F = 1/T;
|
int F = 1/T;
|
||||||
|
|
||||||
void setup() {
|
void setup()
|
||||||
|
{
|
||||||
// put your setup code here, to run once:
|
// put your setup code here, to run once:
|
||||||
pinMode(pin, INPUT);
|
pinMode(pin, INPUT);
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
@@ -15,7 +17,8 @@ void setup() {
|
|||||||
pinMode(rLed, OUTPUT);
|
pinMode(rLed, OUTPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop()
|
||||||
|
{
|
||||||
// put your main code here, to run repeatedly:
|
// put your main code here, to run repeatedly:
|
||||||
delay(1000);
|
delay(1000);
|
||||||
duration = pulseIn(pin, HIGH);
|
duration = pulseIn(pin, HIGH);
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
theme: jekyll-theme-cayman
|
|
@@ -1 +0,0 @@
|
|||||||
theme: jekyll-theme-cayman
|
|
@@ -1,2 +1,2 @@
|
|||||||
# SLEGPI
|
# SLEGPI
|
||||||
This is a repositories to get a short url like : https://junkjumper.github.io/slegpi
|
This is a repositories to get a short url like : https://junkjumper.github.io/SLEGPI
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="active">
|
<li>
|
||||||
<a href="index.html">Homepage</a>
|
<a href="index.html">Homepage</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -31,10 +31,10 @@
|
|||||||
<a href="story.html">Story</a>
|
<a href="story.html">Story</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://www.junkjumper-projects.com/_Project/slegpi/">Demo</a>
|
<a href="license.html">License</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#">License</a>
|
<a href="https://www.junkjumper-projects.com/_Project/slegpi/">Demo</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="last">
|
<li class="last">
|
||||||
<a href="https://github.com/JunkJumper/SLEGPI">Download on Github</a>
|
<a href="https://github.com/JunkJumper/SLEGPI">Download on Github</a>
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
<a href="#Exam">How was the exam with this project ?</a>
|
<a href="#Exam">How was the exam with this project ?</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="last">
|
<li class="last">
|
||||||
<a href="#">Download the latest release !</a>
|
<a href="https://github.com/JunkJumper/SLEGPI/releases" target="_blank">Download the latest release !</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
BIN
docs/img/icons/Arduino_Logo.png
Normal file
BIN
docs/img/icons/Arduino_Logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
BIN
docs/img/icons/bootstrap-plain.png
Normal file
BIN
docs/img/icons/bootstrap-plain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 57 KiB |
BIN
docs/img/icons/css3-plain.png
Normal file
BIN
docs/img/icons/css3-plain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 71 KiB |
BIN
docs/img/icons/html5-plain.png
Normal file
BIN
docs/img/icons/html5-plain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 71 KiB |
BIN
docs/img/icons/javascript-original.png
Normal file
BIN
docs/img/icons/javascript-original.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
BIN
docs/img/icons/jquery-plain.png
Normal file
BIN
docs/img/icons/jquery-plain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 118 KiB |
@@ -19,7 +19,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="active">
|
<li>
|
||||||
<a href="" class="active">Homepage</a>
|
<a href="" class="active">Homepage</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -29,10 +29,10 @@
|
|||||||
<a href="story.html">Story</a>
|
<a href="story.html">Story</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://www.junkjumper-projects.com/_Project/slegpi/">Demo</a>
|
<a href="license.html">License</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#">License</a>
|
<a href="https://www.junkjumper-projects.com/_Project/slegpi/">Demo</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="last">
|
<li class="last">
|
||||||
<a href="https://github.com/JunkJumper/SLEGPI">Download on Github</a>
|
<a href="https://github.com/JunkJumper/SLEGPI">Download on Github</a>
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
<br />
|
<br />
|
||||||
<br />You don't want to miss them, alright ? ;)</p>
|
<br />You don't want to miss them, alright ? ;)</p>
|
||||||
<footer class="more">
|
<footer class="more">
|
||||||
<a href="#">Read More »</a>
|
<a href="story.html">Read More »</a>
|
||||||
</footer>
|
</footer>
|
||||||
</article>
|
</article>
|
||||||
<!-- Download the source code -->
|
<!-- Download the source code -->
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
check them on the appropriate page.</p>
|
check them on the appropriate page.</p>
|
||||||
<br />
|
<br />
|
||||||
<footer class="more">
|
<footer class="more">
|
||||||
<a href="#">Read More »</a>
|
<a href="https://github.com/JunkJumper/SLEGPI">Read More »</a>
|
||||||
</footer>
|
</footer>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
|
87
docs/license.html
Normal file
87
docs/license.html
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" dir="ltr">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>SLEGPI</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<link rel="stylesheet" href="styles/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="styles/style.css" type="text/css">
|
||||||
|
<link rel="shortcut icon" href="/favicons/slegpi.ico" type="image/x-icon">
|
||||||
|
<link rel="icon" href="/favicons/slegpi.ico" type="image/x-icon">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="wrapper row1">
|
||||||
|
<header id="header" class="clear">
|
||||||
|
<div id="hgroup">
|
||||||
|
<a href="index.html">
|
||||||
|
<img src="img/logo_slegpi.png" width="20%" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<nav>
|
||||||
|
<ul>
|
||||||
|
<li class="active">
|
||||||
|
<a href="index.html">Homepage</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="about.html">About</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="story.html">Story</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="" class="active">License</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="https://www.junkjumper-projects.com/_Project/slegpi/">Demo</a>
|
||||||
|
</li>
|
||||||
|
<li class="last">
|
||||||
|
<a href="https://github.com/JunkJumper/SLEGPI">Download on Github</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="wrapper row2">
|
||||||
|
<div id="container" class="clear">
|
||||||
|
<section id="slider">
|
||||||
|
<img src="img/website-resized.png" alt="wbesite" width="960px" height="360px" id="About">
|
||||||
|
</section>
|
||||||
|
<div id="content">
|
||||||
|
<section>
|
||||||
|
<article>
|
||||||
|
<h1>License</h1>
|
||||||
|
<p>The project was created using some softwares, here is the dedicated page to mention them.</p><br /><br />
|
||||||
|
<center>
|
||||||
|
<a href="https://en.wikipedia.org/wiki/HTML" target="_blank"><img src="img/icons/html5-plain.png" alt="Html 5" width="200px"></a>
|
||||||
|
<a href="https://en.wikipedia.org/wiki/Cascading_Style_Sheets" target="_blank"><img src="img/icons/css3-plain.png" alt="Css 3" width="200px"></a>
|
||||||
|
<a href="https://en.wikipedia.org/wiki/JavaScript" target="_blank"><img src="img/icons/javascript-original.png" alt="JavaScript" width="200px"></a><br /><br />
|
||||||
|
<a href="https://www.arduino.cc/" target="_blank"><img src="img/icons/Arduino_Logo.png" alt="Arduino" width="200px"></a>
|
||||||
|
</center>
|
||||||
|
</article>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Copyright -->
|
||||||
|
<div class="wrapper row4">
|
||||||
|
<footer id="footer" class="clear">
|
||||||
|
<p class="fl_left">
|
||||||
|
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/">
|
||||||
|
<img alt="Licence Creative Commons" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" />
|
||||||
|
</a>
|
||||||
|
<img src="img/footer.png" />This page is available under the terms of the
|
||||||
|
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"> Creative Commons Attribution 4.0 International License</a>.</p>
|
||||||
|
<br />
|
||||||
|
<p class="fl_right">Website made by
|
||||||
|
<a target="_blank" href="https://junkjumper.github.io/" title="Free Website Templates">JunkJumper</a>
|
||||||
|
</p>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@@ -21,7 +21,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li class="active">
|
<li>
|
||||||
<a href="index.html">Homepage</a>
|
<a href="index.html">Homepage</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -31,10 +31,10 @@
|
|||||||
<a href="" class="active">Story</a>
|
<a href="" class="active">Story</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://www.junkjumper-projects.com/_Project/slegpi/">Demo</a>
|
<a href="license.html">License</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#">License</a>
|
<a href="https://www.junkjumper-projects.com/_Project/slegpi/">Demo</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="last">
|
<li class="last">
|
||||||
<a href="https://github.com/JunkJumper/SLEGPI">Download on Github</a>
|
<a href="https://github.com/JunkJumper/SLEGPI">Download on Github</a>
|
||||||
|
Reference in New Issue
Block a user