Reorganisation classes 4.1 + TODO

This commit is contained in:
Cameron Bray 2020-05-13 17:18:23 +02:00
parent b25052ecaf
commit a070cc44eb
2 changed files with 17 additions and 17 deletions

View file

@ -6,7 +6,7 @@ int main(){
// creation d'une board // creation d'une board
Board esp8266; Board esp8266;
// achat des senseurs et actionneurs // achat des senseurs et actionneurs
AnalogSensorTemperature temperature(DELAY,TEMP); AnalogSensorTemperature temperature(TEMP,DELAY);
//DigitalActuatorLED led1(DELAY); //DigitalActuatorLED led1(DELAY);
IntelligentDigitalActuatorLED led1(DELAY); IntelligentDigitalActuatorLED led1(DELAY);
I2CActuatorScreen screen; I2CActuatorScreen screen;

View file

@ -61,7 +61,7 @@ IntelligentDigitalActuatorLED::IntelligentDigitalActuatorLED(int t):DigitalDevic
void IntelligentDigitalActuatorLED::run(){ void IntelligentDigitalActuatorLED::run(){
int previousState = LOW; //initialisee a eteint int previousState = LOW; //initialisee a eteint
while(1){ while(1){
if(ptrmem!=NULL) if(ptrmem!=NULL) {
state = *ptrmem; state = *ptrmem;
if (state == LOW) { if (state == LOW) {
cout << "((((eteint))))\n"; cout << "((((eteint))))\n";
@ -69,14 +69,14 @@ void IntelligentDigitalActuatorLED::run(){
luminosite_environnement -= 50; luminosite_environnement -= 50;
} }
previousState = state; previousState = state;
} } else { //state == HIGH
else{ //state == HIGH
cout << "((((allume))))\n"; cout << "((((allume))))\n";
if (state != previousState) { if (state != previousState) {
luminosite_environnement += 50; luminosite_environnement += 50;
} }
previousState = state; previousState = state;
} }
}
sleep(temps); sleep(temps);
} }
} }