Compare commits
8 Commits
feat/AR_Ar
...
a150d1c17f
Author | SHA1 | Date | |
---|---|---|---|
a150d1c17f | |||
96ebd89dd3 | |||
370a16441b | |||
71a07cc552 | |||
b1787886c6 | |||
8928ab9922 | |||
7b5d4a071b | |||
2e4b24df10 |
18
IOT/config.cppcheck
Normal file
18
IOT/config.cppcheck
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="1">
|
||||||
|
<builddir>.cppcheck-build</builddir>
|
||||||
|
<platform>Unspecified</platform>
|
||||||
|
<analyze-all-vs-configs>true</analyze-all-vs-configs>
|
||||||
|
<check-headers>true</check-headers>
|
||||||
|
<check-unused-templates>false</check-unused-templates>
|
||||||
|
<max-ctu-depth>10</max-ctu-depth>
|
||||||
|
<exclude>
|
||||||
|
<path name="./.pio/" />
|
||||||
|
</exclude>
|
||||||
|
<suppressions>
|
||||||
|
<suppression>noCopyConstructor</suppression>
|
||||||
|
<suppression>noExplicitConstructor</suppression>
|
||||||
|
<suppression>unusedFunction</suppression>
|
||||||
|
<suppression>noOperatorEq</suppression>
|
||||||
|
</suppressions>
|
||||||
|
</project>
|
@ -16,5 +16,8 @@ build_flags =
|
|||||||
|
|
||||||
-D API_HOST=\"iot.epi.cb85.software\"
|
-D API_HOST=\"iot.epi.cb85.software\"
|
||||||
|
|
||||||
|
-D ULTRA_SOUND_TRIGD=12
|
||||||
|
-D ULTRA_SOUND_ECHO=13
|
||||||
|
|
||||||
-D EXAMPLE_NUMBER=69
|
-D EXAMPLE_NUMBER=69
|
||||||
|
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
#ifndef PROGRAM_H
|
#ifndef PROGRAM_H
|
||||||
#define PROGRAM_H
|
#define PROGRAM_H
|
||||||
|
|
||||||
|
#include <Arduino.h>
|
||||||
|
#include <Ultrasonic.h>
|
||||||
|
|
||||||
class Program{
|
class Program{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@ -17,5 +20,11 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/* data */
|
/* data */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief capteur ultra son pour le niveau de remplissage de la poubelle
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Ultrasonic *ultrasonic;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
@ -38,6 +38,7 @@ monitor_flags =
|
|||||||
lib_deps =
|
lib_deps =
|
||||||
bportaluri/WiFiEsp@^2.2.2 ; gestion des commande 'AT' de l'esp01
|
bportaluri/WiFiEsp@^2.2.2 ; gestion des commande 'AT' de l'esp01
|
||||||
arduino-libraries/Arduino_JSON@^0.2.0 ; gestion des json
|
arduino-libraries/Arduino_JSON@^0.2.0 ; gestion des json
|
||||||
|
ericksimoes/Ultrasonic@^3.0.0 ; lib capteur ultra son
|
||||||
; example:
|
; example:
|
||||||
; erropix/ESP32 AnalogWrite@^0.2
|
; erropix/ESP32 AnalogWrite@^0.2
|
||||||
|
|
||||||
|
@ -1,10 +1,18 @@
|
|||||||
#include "Program.h"
|
#include "Program.h"
|
||||||
|
|
||||||
|
|
||||||
|
int distance;
|
||||||
|
|
||||||
|
|
||||||
Program::Program(){
|
Program::Program(){
|
||||||
|
Serial.begin(MONITOR_SPEED);
|
||||||
|
this->ultrasonic = new Ultrasonic(ULTRA_SOUND_TRIGD, ULTRA_SOUND_ECHO);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Program::loop(){
|
void Program::loop(){
|
||||||
|
distance = this->ultrasonic->read();
|
||||||
|
|
||||||
|
Serial.print("Distance in CM: ");
|
||||||
|
Serial.println(distance);
|
||||||
|
delay(1000);
|
||||||
}
|
}
|
Reference in New Issue
Block a user