Declaration manometre compile
This commit is contained in:
parent
354f1d0a14
commit
b680750540
14 changed files with 48 additions and 15 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
3
Copie de compile_mac.sh
Executable file
3
Copie de compile_mac.sh
Executable 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
BIN
OtherDevices/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
OtherDevices/AnalogDevices/.DS_Store
vendored
Normal file
BIN
OtherDevices/AnalogDevices/.DS_Store
vendored
Normal file
Binary file not shown.
|
@ -4,9 +4,9 @@
|
||||||
#include "../../include/AnalogDevices/AnalogDevice.h"
|
#include "../../include/AnalogDevices/AnalogDevice.h"
|
||||||
//AnalogDevice ///////////////////
|
//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;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,6 @@ int AnalogDevice::getTemps() const {
|
||||||
return temps;
|
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) {}
|
||||||
|
|
|
@ -3,3 +3,21 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "../../../include/AnalogDevices/AnalogSensors/AnalogSensorManometre.h"
|
#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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -16,4 +16,4 @@ void AnalogSensorTemperature::run(){
|
||||||
*ptrmem=val+alea;
|
*ptrmem=val+alea;
|
||||||
sleep(temps);
|
sleep(temps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
arduino
Executable file
BIN
arduino
Executable file
Binary file not shown.
|
@ -16,6 +16,7 @@ int main(){
|
||||||
I2CActuatorScreen screen;
|
I2CActuatorScreen screen;
|
||||||
AnalogSensorLuminosity luminosite(DELAY);
|
AnalogSensorLuminosity luminosite(DELAY);
|
||||||
ExternalDigitalSensorButton button(DELAY);
|
ExternalDigitalSensorButton button(DELAY);
|
||||||
|
AnalogSensorManometre manometre(DELAY);
|
||||||
|
|
||||||
// branchement des capteurs actionneurs
|
// branchement des capteurs actionneurs
|
||||||
esp8266.pin(1,temperature);
|
esp8266.pin(1,temperature);
|
||||||
|
|
6
compile_mac.sh
Normal file → Executable file
6
compile_mac.sh
Normal file → Executable file
|
@ -1,3 +1,5 @@
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
echo "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 -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
BIN
include/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
include/AnalogDevices/.DS_Store
vendored
Normal file
BIN
include/AnalogDevices/.DS_Store
vendored
Normal file
Binary file not shown.
|
@ -11,24 +11,24 @@
|
||||||
|
|
||||||
class AnalogDevice : public Device{
|
class AnalogDevice : public Device{
|
||||||
protected:
|
protected:
|
||||||
int val;
|
float val;
|
||||||
// temps entre 2 prises de valeurs
|
// temps entre 2 prises de valeurs
|
||||||
int temps;
|
int temps;
|
||||||
// valeur de temperature mesuree
|
// valeur de temperature mesuree
|
||||||
public:
|
public:
|
||||||
AnalogDevice(int val, int temps);
|
AnalogDevice(float val, int temps);
|
||||||
|
|
||||||
int getVal() const;
|
float getVal() const;
|
||||||
int getTemps() const;
|
int getTemps() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AnalogSensor : public AnalogDevice{
|
class AnalogSensor : public AnalogDevice{
|
||||||
public:
|
public:
|
||||||
AnalogSensor(int val, int temps);
|
AnalogSensor(float val, int temps);
|
||||||
};
|
};
|
||||||
|
|
||||||
class AnalogActuator : public AnalogDevice{
|
class AnalogActuator : public AnalogDevice{
|
||||||
public:
|
public:
|
||||||
AnalogActuator(int val, int temps);
|
AnalogActuator(float val, int temps);
|
||||||
};
|
};
|
||||||
#endif //PROJET_VICTORAVECUNK_ANALOGDEVICE_H
|
#endif //PROJET_VICTORAVECUNK_ANALOGDEVICE_H
|
|
@ -4,10 +4,19 @@
|
||||||
|
|
||||||
#ifndef PROJET_VICTORAVECUNK_ANALOGSENSORMANOMETRE_H
|
#ifndef PROJET_VICTORAVECUNK_ANALOGSENSORMANOMETRE_H
|
||||||
#define 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 : public AnalogSensor{
|
||||||
class AnalogSensorManometre {
|
private:
|
||||||
|
int alea;
|
||||||
|
public:
|
||||||
|
AnalogSensorManometre(float val, int t); //
|
||||||
|
virtual void run();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue