Declaration manometre compile

This commit is contained in:
Victor Le Roch 2020-05-16 18:51:29 +02:00
parent 354f1d0a14
commit b680750540
14 changed files with 48 additions and 15 deletions

BIN
.DS_Store vendored

Binary file not shown.

3
Copie de compile_mac.sh Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/bash
echo "g++ -Wall -std=c++11 board.cpp core_simulation.cpp mydevices.cpp sketch_ino.cpp -o arduino"
g++ -Wall -std=c++11 board.cpp core_simulation.cpp mydevices.cpp sketch_ino.cpp -o arduino

BIN
OtherDevices/.DS_Store vendored Normal file

Binary file not shown.

BIN
OtherDevices/AnalogDevices/.DS_Store vendored Normal file

Binary file not shown.

View file

@ -4,9 +4,9 @@
#include "../../include/AnalogDevices/AnalogDevice.h"
//AnalogDevice ///////////////////
AnalogDevice::AnalogDevice(int val, int temps) : Device(), val(val), temps(temps) {}
AnalogDevice::AnalogDevice(float val, int temps) : Device(), val(val), temps(temps) {}
int AnalogDevice::getVal() const {
float AnalogDevice::getVal() const {
return val;
}
@ -14,6 +14,6 @@ int AnalogDevice::getTemps() const {
return temps;
}
AnalogSensor::AnalogSensor(int val, int temps) : AnalogDevice(val, temps) {}
AnalogSensor::AnalogSensor(float val, int temps) : AnalogDevice(val, temps) {}
AnalogActuator::AnalogActuator(int val, int temps) : AnalogDevice(val, temps) {}
AnalogActuator::AnalogActuator(float val, int temps) : AnalogDevice(val, temps) {}

View file

@ -3,3 +3,21 @@
//
#include "../../../include/AnalogDevices/AnalogSensors/AnalogSensorManometre.h"
AnalogSensorManometre::AnalogSensorManometre(float val, int temps):AnalogSensor(val,temps){ alea = 1;}
void AnalogSensorManometre::run(){
int cpt = 0;
while(1){
if(ptrmem!=NULL){
if(cpt%5 == 0){
*ptrmem = val - alea;
}
}
sleep(temps);
cpt++;
if(cpt == 10000){
cpt = 0;
}
}
}

View file

@ -16,4 +16,4 @@ void AnalogSensorTemperature::run(){
*ptrmem=val+alea;
sleep(temps);
}
}
}

BIN
arduino Executable file

Binary file not shown.

View file

@ -16,6 +16,7 @@ int main(){
I2CActuatorScreen screen;
AnalogSensorLuminosity luminosite(DELAY);
ExternalDigitalSensorButton button(DELAY);
AnalogSensorManometre manometre(DELAY);
// branchement des capteurs actionneurs
esp8266.pin(1,temperature);

6
compile_mac.sh Normal file → Executable file
View file

@ -1,3 +1,5 @@
#!/usr/bin/bash
echo "g++ -Wall -std=c++11 board.cpp core_simulation.cpp mydevices.cpp sketch_ino.cpp -o arduino"
g++ -Wall -std=c++11 board.cpp core_simulation.cpp mydevices.cpp sketch_ino.cpp -o arduino
echo "g++ -Wall -std=c++11 board.cpp core_simulation.cpp mydevices.cpp sketch_ino.cpp OtherDevices/DigitalDevices/DigitalDevice.cpp OtherDevices/AnalogDevices/AnalogDevice.cpp OtherDevices/AnalogDevices/AnalogActuators/AnalogActuatorMotor.cpp OtherDevices/AnalogDevices/AnalogSensors/AnalogSensorHumidity.cpp OtherDevices/AnalogDevices/AnalogSensors/AnalogSensorLuminosity.cpp OtherDevices/AnalogDevices/AnalogSensors/AnalogSensorManometre.cpp OtherDevices/AnalogDevices/AnalogSensors/AnalogSensorPHmetre.cpp OtherDevices/AnalogDevices/AnalogSensors/AnalogSensorTemperature.cpp OtherDevices/DigitalDevices/DigitalActuators/DigitalActuatorElectrovanne.cpp OtherDevices/DigitalDevices/DigitalActuators/DigitalActuatorRadiator.cpp OtherDevices/DigitalDevices/DigitalSensors/ExternalDigitalSensorButton.cpp OtherDevices/DigitalDevices/DigitalActuators/IntelligentDigitalActuatorLED.cpp -o arduino"
g++ -Wall -std=c++11 board.cpp core_simulation.cpp mydevices.cpp sketch_ino.cpp OtherDevices/DigitalDevices/DigitalDevice.cpp OtherDevices/AnalogDevices/AnalogDevice.cpp OtherDevices/AnalogDevices/AnalogActuators/AnalogActuatorMotor.cpp OtherDevices/AnalogDevices/AnalogSensors/AnalogSensorHumidity.cpp OtherDevices/AnalogDevices/AnalogSensors/AnalogSensorLuminosity.cpp OtherDevices/AnalogDevices/AnalogSensors/AnalogSensorManometre.cpp OtherDevices/AnalogDevices/AnalogSensors/AnalogSensorPHmetre.cpp OtherDevices/AnalogDevices/AnalogSensors/AnalogSensorTemperature.cpp OtherDevices/DigitalDevices/DigitalActuators/DigitalActuatorElectrovanne.cpp OtherDevices/DigitalDevices/DigitalActuators/DigitalActuatorRadiator.cpp OtherDevices/DigitalDevices/DigitalSensors/ExternalDigitalSensorButton.cpp OtherDevices/DigitalDevices/DigitalActuators/IntelligentDigitalActuatorLED.cpp -o arduino

BIN
include/.DS_Store vendored Normal file

Binary file not shown.

BIN
include/AnalogDevices/.DS_Store vendored Normal file

Binary file not shown.

View file

@ -11,24 +11,24 @@
class AnalogDevice : public Device{
protected:
int val;
float val;
// temps entre 2 prises de valeurs
int temps;
// valeur de temperature mesuree
public:
AnalogDevice(int val, int temps);
AnalogDevice(float val, int temps);
int getVal() const;
float getVal() const;
int getTemps() const;
};
class AnalogSensor : public AnalogDevice{
public:
AnalogSensor(int val, int temps);
AnalogSensor(float val, int temps);
};
class AnalogActuator : public AnalogDevice{
public:
AnalogActuator(int val, int temps);
AnalogActuator(float val, int temps);
};
#endif //PROJET_VICTORAVECUNK_ANALOGDEVICE_H

View file

@ -4,10 +4,19 @@
#ifndef PROJET_VICTORAVECUNK_ANALOGSENSORMANOMETRE_H
#define PROJET_VICTORAVECUNK_ANALOGSENSORMANOMETRE_H
#include <iostream>
#include <thread>
#include <unistd.h>
#include <string.h>
#include <fstream>
#include "../AnalogDevice.h"
class AnalogSensorManometre {
class AnalogSensorManometre : public AnalogSensor{
private:
int alea;
public:
AnalogSensorManometre(float val, int t); //
virtual void run();
};