Reorganisation classes 4.1 + TODO
This commit is contained in:
parent
b25052ecaf
commit
a070cc44eb
2 changed files with 17 additions and 17 deletions
|
@ -6,7 +6,7 @@ int main(){
|
|||
// creation d'une board
|
||||
Board esp8266;
|
||||
// achat des senseurs et actionneurs
|
||||
AnalogSensorTemperature temperature(DELAY,TEMP);
|
||||
AnalogSensorTemperature temperature(TEMP,DELAY);
|
||||
//DigitalActuatorLED led1(DELAY);
|
||||
IntelligentDigitalActuatorLED led1(DELAY);
|
||||
I2CActuatorScreen screen;
|
||||
|
|
|
@ -61,22 +61,22 @@ IntelligentDigitalActuatorLED::IntelligentDigitalActuatorLED(int t):DigitalDevic
|
|||
void IntelligentDigitalActuatorLED::run(){
|
||||
int previousState = LOW; //initialisee a eteint
|
||||
while(1){
|
||||
if(ptrmem!=NULL)
|
||||
state=*ptrmem;
|
||||
if (state==LOW ){
|
||||
cout << "((((eteint))))\n";
|
||||
if(state != previousState){
|
||||
luminosite_environnement-= 50;
|
||||
}
|
||||
previousState = state;
|
||||
}
|
||||
else{ //state == HIGH
|
||||
cout << "((((allume))))\n";
|
||||
if(state != previousState){
|
||||
luminosite_environnement+= 50;
|
||||
}
|
||||
previousState = state;
|
||||
}
|
||||
if(ptrmem!=NULL) {
|
||||
state = *ptrmem;
|
||||
if (state == LOW) {
|
||||
cout << "((((eteint))))\n";
|
||||
if (state != previousState) {
|
||||
luminosite_environnement -= 50;
|
||||
}
|
||||
previousState = state;
|
||||
} else { //state == HIGH
|
||||
cout << "((((allume))))\n";
|
||||
if (state != previousState) {
|
||||
luminosite_environnement += 50;
|
||||
}
|
||||
previousState = state;
|
||||
}
|
||||
}
|
||||
sleep(temps);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue