Modifications

Aller à : navigation, rechercher

TransmutationsDeBase

40 octets ajoutés, 4 mai 2016 à 08:05
code-source
class Cooker
{
byte relaisPin;
}
};
// constants attribution des pins // 2, 3, 4, 5, 14, 19
// constantes decalage des cb avant de passer etat 2 = // 9000; 11400; 12000; 12600; // // Intervalle de chauffe durant l'etat 2 = // 1500; 1900; 2200; 3000; //
unsigned int globalState ; unsigned int prevGlobalState = 0;
unsigned long epoch = 0;
// on instancie
Cooker relais0(2, 9000, 1500); Cooker relais1(3, 11400, 1900); Cooker relais2(4, 12000, 2200); Cooker relais3(5, 12600, 3000); Cooker relais4(14, 8000, 2200); Cooker relais5(19, 14000, 3500);
//////////////////////////////////////////////// /////////////// telecommande RF /////////////// ////////////////////////////////////////////////
/*The following 4 pin definitions,correspond to 4 buttons on the remote control //(The telecontroller is Remote Wireless Keynob 315MHz(SKU:FIT0355))*/ const unsigned int D1 = 8; //The digital output pin 1 of decoder chip(SC2272) const unsigned int D2 = 9; //The digital output pin 2 of decoder chip(SC2272) const unsigned int D3 = 10; //The digital output pin 3 of decoder chip(SC2272) const unsigned int D4 = 11; //The digital output pin 4 of decoder chip(SC2272) const unsigned int ledPin = 13; //Receiving indicator
volatile int stateRF = LOW;
void setup() {
Serial.begin(9600);
epoch = millis(); // pour stocker le chrono depuis le démarrage
//receiving interrupt pin of the decoding chip
digitalWrite(ledPin, LOW);
}
void loop() {
ecouteRadio(); // la commande RF actualise l'etat global
relais5.Full();
}
} /////////////// les fonctions //////////////////////
void blink() {
stateRF = ! stateRF;
} ////////////////////////////////// void ecouteRadio() {
delay(1);
digitalWrite(ledPin, HIGH);
Serial.println("Alarm : FULL");
}
digitalWrite(ledPin, LOW); }
Emailconfirmed
470
modifications

Menu de navigation