Compare commits
26 Commits
6744680a1f
...
docs/kicad
Author | SHA1 | Date | |
---|---|---|---|
5f057c2278 | |||
29e1c1b73a | |||
b9b6d71ba0 | |||
b0c90360b8 | |||
f2bd530d4e | |||
d814d16733 | |||
ddefd7e15f | |||
b62d0d74c6 | |||
79d5ecde9e | |||
e4cf250092 | |||
fa43f37279 | |||
2708df56a6 | |||
19b716aaf2 | |||
95aabd8903 | |||
a34b4acbc0 | |||
3a45e8e9b5 | |||
107ca935b8 | |||
922d6e85f0 | |||
2b4e0fd9ea | |||
d69dc54f48 | |||
36dd744da5 | |||
e939ee757d | |||
2b318c00f9 | |||
8477942be8 | |||
493e571e32 | |||
84cd9912c9 |
@ -14,6 +14,14 @@ build_flags =
|
|||||||
-D MONITOR_SPEED=${config.monitor_speed}
|
-D MONITOR_SPEED=${config.monitor_speed}
|
||||||
; DO NOT TOUCH --- END
|
; DO NOT TOUCH --- END
|
||||||
|
|
||||||
|
; taille ecran oled
|
||||||
|
; 3,3v
|
||||||
|
-D OLED_WIDTH=128
|
||||||
|
-D OLED_HEIGHT=64
|
||||||
|
; pin de reset de l'ecran oled
|
||||||
|
-D OLED_RESET=-1
|
||||||
|
|
||||||
|
|
||||||
; DHT pin and type
|
; DHT pin and type
|
||||||
; 5v
|
; 5v
|
||||||
-D DHTTYPE=\"DHT11\"
|
-D DHTTYPE=\"DHT11\"
|
||||||
@ -25,14 +33,19 @@ build_flags =
|
|||||||
-D ULTRA_SOUND_ECHO=13
|
-D ULTRA_SOUND_ECHO=13
|
||||||
|
|
||||||
; Capteur poids
|
; Capteur poids
|
||||||
|
; 3,3v
|
||||||
-D POID_DOUT=14
|
-D POID_DOUT=14
|
||||||
-D POID_SCK=15
|
-D POID_SCK=15
|
||||||
|
|
||||||
-D MOYENNE_CALIBRATION=20
|
|
||||||
|
|
||||||
|
|
||||||
; trash can ID
|
; trash can ID
|
||||||
-D TRASHCAN_ONE=\"gdnuxl0wlgurtj3\"
|
-D TRASHCAN_ONE=\"gdnuxl0wlgurtj3\"
|
||||||
-D TRASHCAN_TWO=\"4brip5fwm001bs9\"
|
-D TRASHCAN_TWO=\"4brip5fwm001bs9\"
|
||||||
|
-D TRASHCAN_THREE=\"n4il9ckl5016aqi\"
|
||||||
|
|
||||||
|
-D API_HOST=\"iot.epi.cb85.software\"
|
||||||
|
|
||||||
|
;---CAPTEUR FULL CONFIG---
|
||||||
|
|
||||||
|
-D ULTRA_SOUND_FULL=\"10\"
|
||||||
|
-D DHT_FULL=\"20:30/60:80\"
|
||||||
|
-D POID_FULL=\"100\"
|
@ -18,7 +18,50 @@ Class Program {
|
|||||||
+ setup()
|
+ setup()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract Class Capteur {
|
||||||
|
# full: bool
|
||||||
|
# type: String
|
||||||
|
# fullVall: String
|
||||||
|
+ Capteur(type: String, fullVal: String)
|
||||||
|
+ {abstract} tar(val: int): bool
|
||||||
|
+ {abstract} read(): String = 0
|
||||||
|
+ isFull(): bool
|
||||||
|
+ getValType(): String
|
||||||
|
}
|
||||||
|
|
||||||
|
class Balance{
|
||||||
|
- capteur: HX711*
|
||||||
|
- initialized: bool
|
||||||
|
- calibrationFact: int
|
||||||
|
- initialVal: long
|
||||||
|
+ Balance(doutPin: int, sck: int, fullVal:String)
|
||||||
|
+ read(): String
|
||||||
|
+ initCalibration(): bool
|
||||||
|
+ calibration(poidsRef: int, moyenneCalibration: int): bool
|
||||||
|
+ tar(val: int = 0): bool
|
||||||
|
}
|
||||||
|
|
||||||
|
class Ultrason{
|
||||||
|
- capteur: DHT*
|
||||||
|
+ HumiTemp(pin: int, type: String, fullVal: String)
|
||||||
|
+ read(): String
|
||||||
|
}
|
||||||
|
|
||||||
|
class Ultrason{
|
||||||
|
- capteur: Ultrasonic*
|
||||||
|
+ Ultrason(triguer: int, echo: int, fullVal: String)
|
||||||
|
+ read(): String
|
||||||
|
}
|
||||||
|
|
||||||
|
Balance --|> Capteur
|
||||||
|
Ultrason --|> Capteur
|
||||||
|
HumiTemp --|> Capteur
|
||||||
|
|
||||||
|
|
||||||
|
API -> Program
|
||||||
|
Program <-- Balance
|
||||||
|
Program <-- Ultrason
|
||||||
|
Program <-- HumiTemp
|
||||||
|
|
||||||
|
|
||||||
@enduml
|
@enduml
|
1
IOT/docs/schéma/shéma poubelle/#auto_saved_files#
Normal file
1
IOT/docs/schéma/shéma poubelle/#auto_saved_files#
Normal file
@ -0,0 +1 @@
|
|||||||
|
/run/media/clement/Data/Mes_Docmument/Documents/Epitech/T-DEV-811/projet/project/IOT/docs/schéma/shéma poubelle/_autosave-shéma poubelle.kicad_sch
|
1267
IOT/docs/schéma/shéma poubelle/_autosave-shéma poubelle.kicad_sch
Normal file
1267
IOT/docs/schéma/shéma poubelle/_autosave-shéma poubelle.kicad_sch
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
2
IOT/docs/schéma/shéma poubelle/shéma poubelle.kicad_pcb
Normal file
2
IOT/docs/schéma/shéma poubelle/shéma poubelle.kicad_pcb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
(kicad_pcb (version 20221018) (generator pcbnew)
|
||||||
|
)
|
77
IOT/docs/schéma/shéma poubelle/shéma poubelle.kicad_prl
Normal file
77
IOT/docs/schéma/shéma poubelle/shéma poubelle.kicad_prl
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
{
|
||||||
|
"board": {
|
||||||
|
"active_layer": 0,
|
||||||
|
"active_layer_preset": "",
|
||||||
|
"auto_track_width": true,
|
||||||
|
"hidden_netclasses": [],
|
||||||
|
"hidden_nets": [],
|
||||||
|
"high_contrast_mode": 0,
|
||||||
|
"net_color_mode": 1,
|
||||||
|
"opacity": {
|
||||||
|
"images": 0.6,
|
||||||
|
"pads": 1.0,
|
||||||
|
"tracks": 1.0,
|
||||||
|
"vias": 1.0,
|
||||||
|
"zones": 0.6
|
||||||
|
},
|
||||||
|
"selection_filter": {
|
||||||
|
"dimensions": true,
|
||||||
|
"footprints": true,
|
||||||
|
"graphics": true,
|
||||||
|
"keepouts": true,
|
||||||
|
"lockedItems": false,
|
||||||
|
"otherItems": true,
|
||||||
|
"pads": true,
|
||||||
|
"text": true,
|
||||||
|
"tracks": true,
|
||||||
|
"vias": true,
|
||||||
|
"zones": true
|
||||||
|
},
|
||||||
|
"visible_items": [
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11,
|
||||||
|
12,
|
||||||
|
13,
|
||||||
|
15,
|
||||||
|
16,
|
||||||
|
17,
|
||||||
|
18,
|
||||||
|
19,
|
||||||
|
20,
|
||||||
|
21,
|
||||||
|
22,
|
||||||
|
23,
|
||||||
|
24,
|
||||||
|
25,
|
||||||
|
26,
|
||||||
|
27,
|
||||||
|
28,
|
||||||
|
29,
|
||||||
|
30,
|
||||||
|
32,
|
||||||
|
33,
|
||||||
|
34,
|
||||||
|
35,
|
||||||
|
36,
|
||||||
|
39,
|
||||||
|
40
|
||||||
|
],
|
||||||
|
"visible_layers": "fffffff_ffffffff",
|
||||||
|
"zone_display_mode": 0
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"filename": "shéma poubelle.kicad_prl",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"project": {
|
||||||
|
"files": []
|
||||||
|
}
|
||||||
|
}
|
327
IOT/docs/schéma/shéma poubelle/shéma poubelle.kicad_pro
Normal file
327
IOT/docs/schéma/shéma poubelle/shéma poubelle.kicad_pro
Normal file
@ -0,0 +1,327 @@
|
|||||||
|
{
|
||||||
|
"board": {
|
||||||
|
"3dviewports": [],
|
||||||
|
"design_settings": {
|
||||||
|
"defaults": {
|
||||||
|
"board_outline_line_width": 0.1,
|
||||||
|
"copper_line_width": 0.2,
|
||||||
|
"copper_text_size_h": 1.5,
|
||||||
|
"copper_text_size_v": 1.5,
|
||||||
|
"copper_text_thickness": 0.3,
|
||||||
|
"other_line_width": 0.15,
|
||||||
|
"silk_line_width": 0.15,
|
||||||
|
"silk_text_size_h": 1.0,
|
||||||
|
"silk_text_size_v": 1.0,
|
||||||
|
"silk_text_thickness": 0.15
|
||||||
|
},
|
||||||
|
"diff_pair_dimensions": [],
|
||||||
|
"drc_exclusions": [],
|
||||||
|
"rules": {
|
||||||
|
"min_copper_edge_clearance": 0.0,
|
||||||
|
"solder_mask_clearance": 0.0,
|
||||||
|
"solder_mask_min_width": 0.0
|
||||||
|
},
|
||||||
|
"track_widths": [],
|
||||||
|
"via_dimensions": []
|
||||||
|
},
|
||||||
|
"layer_presets": [],
|
||||||
|
"viewports": []
|
||||||
|
},
|
||||||
|
"boards": [],
|
||||||
|
"cvpcb": {
|
||||||
|
"equivalence_files": []
|
||||||
|
},
|
||||||
|
"erc": {
|
||||||
|
"erc_exclusions": [],
|
||||||
|
"meta": {
|
||||||
|
"version": 0
|
||||||
|
},
|
||||||
|
"pin_map": [
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"rule_severities": {
|
||||||
|
"bus_definition_conflict": "error",
|
||||||
|
"bus_entry_needed": "error",
|
||||||
|
"bus_to_bus_conflict": "error",
|
||||||
|
"bus_to_net_conflict": "error",
|
||||||
|
"conflicting_netclasses": "error",
|
||||||
|
"different_unit_footprint": "error",
|
||||||
|
"different_unit_net": "error",
|
||||||
|
"duplicate_reference": "error",
|
||||||
|
"duplicate_sheet_names": "error",
|
||||||
|
"endpoint_off_grid": "warning",
|
||||||
|
"extra_units": "error",
|
||||||
|
"global_label_dangling": "warning",
|
||||||
|
"hier_label_mismatch": "error",
|
||||||
|
"label_dangling": "error",
|
||||||
|
"lib_symbol_issues": "warning",
|
||||||
|
"missing_bidi_pin": "warning",
|
||||||
|
"missing_input_pin": "warning",
|
||||||
|
"missing_power_pin": "error",
|
||||||
|
"missing_unit": "warning",
|
||||||
|
"multiple_net_names": "warning",
|
||||||
|
"net_not_bus_member": "warning",
|
||||||
|
"no_connect_connected": "warning",
|
||||||
|
"no_connect_dangling": "warning",
|
||||||
|
"pin_not_connected": "error",
|
||||||
|
"pin_not_driven": "error",
|
||||||
|
"pin_to_pin": "warning",
|
||||||
|
"power_pin_not_driven": "error",
|
||||||
|
"similar_labels": "warning",
|
||||||
|
"simulation_model_issue": "ignore",
|
||||||
|
"unannotated": "error",
|
||||||
|
"unit_value_mismatch": "error",
|
||||||
|
"unresolved_variable": "error",
|
||||||
|
"wire_dangling": "error"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libraries": {
|
||||||
|
"pinned_footprint_libs": [],
|
||||||
|
"pinned_symbol_libs": []
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"filename": "shéma poubelle.kicad_pro",
|
||||||
|
"version": 1
|
||||||
|
},
|
||||||
|
"net_settings": {
|
||||||
|
"classes": [
|
||||||
|
{
|
||||||
|
"bus_width": 12,
|
||||||
|
"clearance": 0.2,
|
||||||
|
"diff_pair_gap": 0.25,
|
||||||
|
"diff_pair_via_gap": 0.25,
|
||||||
|
"diff_pair_width": 0.2,
|
||||||
|
"line_style": 0,
|
||||||
|
"microvia_diameter": 0.3,
|
||||||
|
"microvia_drill": 0.1,
|
||||||
|
"name": "Default",
|
||||||
|
"pcb_color": "rgba(0, 0, 0, 0.000)",
|
||||||
|
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||||
|
"track_width": 0.25,
|
||||||
|
"via_diameter": 0.8,
|
||||||
|
"via_drill": 0.4,
|
||||||
|
"wire_width": 6
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"meta": {
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"net_colors": null,
|
||||||
|
"netclass_assignments": null,
|
||||||
|
"netclass_patterns": []
|
||||||
|
},
|
||||||
|
"pcbnew": {
|
||||||
|
"last_paths": {
|
||||||
|
"gencad": "",
|
||||||
|
"idf": "",
|
||||||
|
"netlist": "",
|
||||||
|
"specctra_dsn": "",
|
||||||
|
"step": "",
|
||||||
|
"vrml": ""
|
||||||
|
},
|
||||||
|
"page_layout_descr_file": ""
|
||||||
|
},
|
||||||
|
"schematic": {
|
||||||
|
"annotate_start_num": 0,
|
||||||
|
"drawing": {
|
||||||
|
"dashed_lines_dash_length_ratio": 12.0,
|
||||||
|
"dashed_lines_gap_length_ratio": 3.0,
|
||||||
|
"default_line_thickness": 6.0,
|
||||||
|
"default_text_size": 50.0,
|
||||||
|
"field_names": [],
|
||||||
|
"intersheets_ref_own_page": false,
|
||||||
|
"intersheets_ref_prefix": "",
|
||||||
|
"intersheets_ref_short": false,
|
||||||
|
"intersheets_ref_show": false,
|
||||||
|
"intersheets_ref_suffix": "",
|
||||||
|
"junction_size_choice": 3,
|
||||||
|
"label_size_ratio": 0.375,
|
||||||
|
"pin_symbol_size": 25.0,
|
||||||
|
"text_offset_ratio": 0.15
|
||||||
|
},
|
||||||
|
"legacy_lib_dir": "",
|
||||||
|
"legacy_lib_list": [],
|
||||||
|
"meta": {
|
||||||
|
"version": 1
|
||||||
|
},
|
||||||
|
"net_format_name": "",
|
||||||
|
"page_layout_descr_file": "",
|
||||||
|
"plot_directory": "",
|
||||||
|
"spice_current_sheet_as_root": false,
|
||||||
|
"spice_external_command": "spice \"%I\"",
|
||||||
|
"spice_model_current_sheet_as_root": true,
|
||||||
|
"spice_save_all_currents": false,
|
||||||
|
"spice_save_all_voltages": false,
|
||||||
|
"subpart_first_id": 65,
|
||||||
|
"subpart_id_separator": 0
|
||||||
|
},
|
||||||
|
"sheets": [],
|
||||||
|
"text_variables": {}
|
||||||
|
}
|
5
IOT/docs/schéma/shéma poubelle/shéma poubelle.kicad_sch
Normal file
5
IOT/docs/schéma/shéma poubelle/shéma poubelle.kicad_sch
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
(kicad_sch (version 20230121) (generator eeschema)
|
||||||
|
(paper "A4")
|
||||||
|
(lib_symbols)
|
||||||
|
(symbol_instances)
|
||||||
|
)
|
20
IOT/docs/schéma/ultrasound.lib
Normal file
20
IOT/docs/schéma/ultrasound.lib
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
EESchema-LIBRARY Version 2.3
|
||||||
|
#encoding utf-8
|
||||||
|
#
|
||||||
|
# HC-SR04
|
||||||
|
#
|
||||||
|
DEF HC-SR04 U 0 40 Y Y 1 F N
|
||||||
|
F0 "U" -250 -300 60 H V C CNN
|
||||||
|
F1 "HC-SR04" -100 300 60 H V C CNN
|
||||||
|
F2 "" 0 0 60 H V C CNN
|
||||||
|
F3 "" 0 0 60 H V C CNN
|
||||||
|
DRAW
|
||||||
|
S 0 250 -300 -250 0 1 0 N
|
||||||
|
X VCC 1 200 150 200 L 50 50 1 1 I
|
||||||
|
X TRIG 2 200 50 200 L 50 50 1 1 I
|
||||||
|
X ECHO 3 200 -50 200 L 50 50 1 1 I
|
||||||
|
X GND 4 200 -150 200 L 50 50 1 1 I
|
||||||
|
ENDDRAW
|
||||||
|
ENDDEF
|
||||||
|
#
|
||||||
|
#End Library
|
@ -10,6 +10,7 @@
|
|||||||
#include "Ultrason.h"
|
#include "Ultrason.h"
|
||||||
#include "HumiTemp.h"
|
#include "HumiTemp.h"
|
||||||
#include "Balance.h"
|
#include "Balance.h"
|
||||||
|
#include "OledScreen.h"
|
||||||
|
|
||||||
class Program{
|
class Program{
|
||||||
public:
|
public:
|
||||||
@ -44,9 +45,13 @@ private:
|
|||||||
* @brief capteur poid pour le niveau de remplissage de la poubelle
|
* @brief capteur poid pour le niveau de remplissage de la poubelle
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Balance *balance;
|
Capteur *balance;
|
||||||
|
|
||||||
//TODO chagé type to capteur
|
/**
|
||||||
|
* @brief OledScreen
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
OledScreen* screen;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Réference de l'API pour les calls
|
* @brief Réference de l'API pour les calls
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
#include "../include/Balance.h"
|
|
||||||
|
|
||||||
Balance::Balance(int doutPin, int sckPin) {
|
|
||||||
|
|
||||||
scale.begin(doutPin, sckPin);
|
|
||||||
this->initialized = false;
|
|
||||||
scale.set_scale();
|
|
||||||
scale.tare();
|
|
||||||
this->initialVal = 0;
|
|
||||||
this->calibrationFact = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean Balance::initCalibration() {
|
|
||||||
|
|
||||||
scale.set_scale();
|
|
||||||
scale.tare();
|
|
||||||
this->initialVal = scale.read_average(20);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean Balance::calibration(int poidsRef,int moyenne_calibration) {
|
|
||||||
|
|
||||||
int rawValref = 0; // Valeur brute de plexiglas et poids réf
|
|
||||||
int tempPoids = 0; // C'est la valeur du poids en grammes calculée grâce au facteur de calibration
|
|
||||||
|
|
||||||
rawValref = scale.read_average(moyenne_calibration);
|
|
||||||
this->calibrationFact = (rawValref - this->initialVal) / poidsRef;
|
|
||||||
do {
|
|
||||||
scale.set_scale(calibrationFact);
|
|
||||||
tempPoids = scale.get_units(5);
|
|
||||||
if (tempPoids < poidsRef) {
|
|
||||||
calibrationFact -= 1;
|
|
||||||
} else if (tempPoids > poidsRef) {
|
|
||||||
calibrationFact += 1;
|
|
||||||
}
|
|
||||||
} while (tempPoids != poidsRef);
|
|
||||||
return initialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
double Balance::getAverage(int nbMesure) {
|
|
||||||
|
|
||||||
if (initialized == true) {
|
|
||||||
return scale.get_units(nbMesure);
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
double Balance::getValue() {
|
|
||||||
|
|
||||||
if (initialized == true) {
|
|
||||||
return scale.get_units();
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Balance::setCalibrationFact(int caliFact){
|
|
||||||
this->initialized = true;
|
|
||||||
this->calibrationFact = caliFact;
|
|
||||||
scale.set_scale(caliFact);
|
|
||||||
}
|
|
@ -3,41 +3,32 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <HX711.h>
|
#include <HX711.h>
|
||||||
|
|
||||||
class Balance {
|
#include "Capteur.h"
|
||||||
|
|
||||||
|
class Balance: public Capteur{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief constructeur
|
* @brief constructeur
|
||||||
*
|
*
|
||||||
* @param doutPin : pin DOUT du module HX711
|
* @param[in] doutPin : pin DOUT du module HX711
|
||||||
*
|
* @param[in] sckPin : pin horloge du module HX711
|
||||||
* @param sckPin : pin horloge du module HX711
|
* @param[in] fullVall : valeur a la quel la poubelle est pleine
|
||||||
*
|
*/
|
||||||
* @param poidsRef : valeur de poids posée sur la balance ref en grammes
|
Balance(int doutPin, int sckPin, String fullVall);
|
||||||
*/
|
|
||||||
Balance(int doutPin, int sckPin);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief determine le poids
|
* @brief lit la valeur du capteur de poid
|
||||||
*
|
*
|
||||||
* @return poids (double)
|
* @return String retour la valeur
|
||||||
*/
|
*/
|
||||||
double getValue();
|
String read();
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief determine la moyenne poids
|
|
||||||
*
|
|
||||||
* @param nbMesure : nombre de mesure effectues pour la moyenne
|
|
||||||
*
|
|
||||||
* @return moyenne poids (double)
|
|
||||||
*/
|
|
||||||
double getAverage(int nbMesure);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief tare et scale a 0, et recuperation de la valeur brut du plateau
|
* @brief tare et scale a 0, et recuperation de la valeur brut du plateau
|
||||||
*/
|
*/
|
||||||
boolean initCalibration();
|
bool initCalibration();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief initialisation du calibrage
|
* @brief initialisation du calibrage
|
||||||
@ -47,29 +38,34 @@ public:
|
|||||||
*
|
*
|
||||||
* @return renvoi un true si calibration bien effectue
|
* @return renvoi un true si calibration bien effectue
|
||||||
*/
|
*/
|
||||||
boolean calibration(int poidsRef,int moyenne_calibration);
|
bool calibration(int poidsRef,int moyenne_calibration);
|
||||||
|
|
||||||
//TODO: faire doc setCalibration fact
|
|
||||||
void setCalibrationFact(int caliFact);
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief tar le capteur de poids
|
||||||
|
*
|
||||||
|
* @param[in] val valeur de référence du capteur
|
||||||
|
* @return true si la tarre a bien réussi (ou si il n'a pas besoins de tarre)
|
||||||
|
* @return false erreur durrant la tar
|
||||||
|
*/
|
||||||
|
bool tar(int val = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Variable issue de la librairie HX711 qui permet d'utiliser les fonctions de celle-ci
|
||||||
|
*/
|
||||||
|
HX711* capteur;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief true = calibration et false = erreur
|
* @brief true = calibration et false = erreur
|
||||||
*/
|
*/
|
||||||
boolean initialized;
|
bool initialized;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Facteur de calibration obtenu par : (val brute poids ref - val brute poids plexiglas)/ poids ref
|
* @brief Facteur de calibration obtenu par : (val brute poids ref - val brute poids plexiglas)/ poids ref
|
||||||
*/
|
*/
|
||||||
int calibrationFact;
|
int calibrationFact;
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Variable issue de la librairie HX711 qui permet d'utiliser les fonctions de celle-ci
|
|
||||||
*/
|
|
||||||
HX711 scale;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Valeur moyenne brute du poids sans rien sur la balance juste le plexiglas
|
* @brief Valeur moyenne brute du poids sans rien sur la balance juste le plexiglas
|
||||||
*/
|
*/
|
@ -7,59 +7,59 @@ class Capteur{
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Construct a new Capteur object
|
* @brief Construct a new Capteur object
|
||||||
*
|
*
|
||||||
* @param[in] type type de mesure lue (T/H, W, D,...)
|
* @param[in] type type de mesure lue (T/H, W, D,...)
|
||||||
* @param[in] fullVal valeur a la quel la poubelle est considéré comme pleine
|
* @param[in] fullVal valeur a la quel la poubelle est considéré comme pleine
|
||||||
*/
|
*/
|
||||||
Capteur(String type, String fullVal);
|
Capteur(String type, String fullVal);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief tar le capteur si il a besoins d'être tarré
|
* @brief tar le capteur si il a besoins d'être tarré
|
||||||
*
|
*
|
||||||
* @param[in] val *opt* si le capteur a besoins d'une valeur de ref pour être tarré
|
* @param[in] val *opt* si le capteur a besoins d'une valeur de ref pour être tarré
|
||||||
* @return true si la tarre a bien réussi (ou si il n'a pas besoins de tarre)
|
* @return true si la tarre a bien réussi (ou si il n'a pas besoins de tarre)
|
||||||
* @return false erreur durrant la tar
|
* @return false erreur durrant la tar
|
||||||
*/
|
*/
|
||||||
virtual bool tar(int val = 0);
|
virtual bool tar(int val = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief lit la valeur du capteur
|
* @brief lit la valeur du capteur
|
||||||
*
|
*
|
||||||
* @return String retour la valeur
|
* @return String retour la valeur
|
||||||
*/
|
*/
|
||||||
virtual String read() = 0;
|
virtual String read() = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief revoie la valeur full
|
* @brief revoie la valeur full
|
||||||
*
|
*
|
||||||
* @return true la poubelle est pleine
|
* @return true la poubelle est pleine
|
||||||
* @return false la poubelle n'est pas pleine
|
* @return false la poubelle n'est pas pleine
|
||||||
*/
|
*/
|
||||||
bool isFull();
|
bool isFull();
|
||||||
|
|
||||||
String getValType();
|
String getValType();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief la poubelle est pleinne
|
* @brief la poubelle est pleinne
|
||||||
* est mis a jours par read()
|
* est mis a jours par read()
|
||||||
*/
|
*/
|
||||||
bool full;
|
bool full;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief type de mesure lue (T/H, W, D,...)
|
* @brief type de mesure lue (T/H, W, D,...)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
String type;
|
String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief valeur a la quel la poubelle est considéré comme pleine
|
* @brief valeur a la quel la poubelle est considéré comme pleine
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
String fullVall;
|
String fullVall;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
58
IOT/lib/Capteur/src/Balance.cpp
Normal file
58
IOT/lib/Capteur/src/Balance.cpp
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#include "../include/Balance.h"
|
||||||
|
|
||||||
|
Balance::Balance(int doutPin, int sckPin, String fullVall):
|
||||||
|
Capteur("W", fullVall){
|
||||||
|
|
||||||
|
this->capteur = new HX711();
|
||||||
|
this->capteur->begin(doutPin, sckPin);
|
||||||
|
this->initialized = false;
|
||||||
|
this->capteur->set_scale();
|
||||||
|
this->capteur->tare();
|
||||||
|
this->initialVal = 0;
|
||||||
|
this->calibrationFact = 0;
|
||||||
|
this->initCalibration();
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean Balance::initCalibration() {
|
||||||
|
|
||||||
|
this->capteur->set_scale();
|
||||||
|
this->capteur->tare();
|
||||||
|
this->initialVal = this->capteur->read_average(20);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean Balance::calibration(int poidsRef,int moyenne_calibration) {
|
||||||
|
|
||||||
|
int rawValref = 0; // Valeur brute de plexiglas et poids réf
|
||||||
|
int tempPoids = 0; // C'est la valeur du poids en grammes calculée grâce au facteur de calibration
|
||||||
|
|
||||||
|
rawValref = this->capteur->read_average(moyenne_calibration);
|
||||||
|
this->calibrationFact = (rawValref - this->initialVal) / poidsRef;
|
||||||
|
do {
|
||||||
|
this->capteur->set_scale(calibrationFact);
|
||||||
|
tempPoids = this->capteur->get_units(5);
|
||||||
|
if (tempPoids < poidsRef) {
|
||||||
|
calibrationFact -= 1;
|
||||||
|
} else if (tempPoids > poidsRef) {
|
||||||
|
calibrationFact += 1;
|
||||||
|
}
|
||||||
|
} while (tempPoids != poidsRef);
|
||||||
|
return initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
String Balance::read() {
|
||||||
|
int sortie = (int)this->capteur->get_units();
|
||||||
|
this->full = sortie > this->fullVall.toInt();
|
||||||
|
if (this->initialized == true) {
|
||||||
|
return String(sortie);
|
||||||
|
} else {
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Balance::tar(int val){
|
||||||
|
this->initialized = true;
|
||||||
|
this->calibrationFact = val;
|
||||||
|
this->capteur->set_scale(val);
|
||||||
|
return this->initialized;
|
||||||
|
}
|
59
IOT/lib/OledScreen/include/OledScreen.h
Normal file
59
IOT/lib/OledScreen/include/OledScreen.h
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
#ifndef OLED_SCREEN_H
|
||||||
|
#define OLED_SCREEN_H
|
||||||
|
|
||||||
|
#include <Adafruit_SSD1306.h>
|
||||||
|
|
||||||
|
|
||||||
|
class OledScreen {
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Construct a new Oled Screen object
|
||||||
|
*
|
||||||
|
* @param screenWidth The width of the screen
|
||||||
|
* @param screenHeight The height of the screen
|
||||||
|
* @param oledResetPin The pin used to reset the screen (default: -1)
|
||||||
|
*/
|
||||||
|
OledScreen(int screenWidth, int screenHeight, int oledResetPin = -1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief display welcome screen
|
||||||
|
*/
|
||||||
|
void welcome();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief print the total amount on the screen
|
||||||
|
*
|
||||||
|
* @param amount The total amount to print in centimes
|
||||||
|
*/
|
||||||
|
void printAmount(int amount);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clear the screen
|
||||||
|
*/
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief messsage for wifi waiting
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void wifiWaiting();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief show the sensor value
|
||||||
|
*
|
||||||
|
* @param distance length value
|
||||||
|
* @param poid weith value
|
||||||
|
* @param humitemp humidity and temperature value
|
||||||
|
*/
|
||||||
|
void printVal(String distance, String poid, String humitemp);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
Adafruit_SSD1306* display;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
76
IOT/lib/OledScreen/src/OledScreeen.cpp
Normal file
76
IOT/lib/OledScreen/src/OledScreeen.cpp
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
#include "../include/OledScreen.h"
|
||||||
|
|
||||||
|
OledScreen::OledScreen(int screenWidth, int screenHeight, int oledResetPin) {
|
||||||
|
this->display = new Adafruit_SSD1306(screenWidth, screenHeight, &Wire, oledResetPin);
|
||||||
|
if (!display->begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
|
||||||
|
Serial.println(F("SSD1306 allocation failed"));
|
||||||
|
for (;;); // Don't proceed, loop forever
|
||||||
|
}
|
||||||
|
this->display->clearDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OledScreen::welcome() {
|
||||||
|
this->display->clearDisplay();
|
||||||
|
this->display->setCursor(0, 0);
|
||||||
|
this->display->setTextSize(2);
|
||||||
|
this->display->setTextColor(WHITE);
|
||||||
|
this->display->println(F("\nBienvenue!"));
|
||||||
|
this->display->display();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OledScreen::printVal(String distance, String poid, String humitemp){
|
||||||
|
this->display->clearDisplay();
|
||||||
|
this->display->setCursor(0, 0);
|
||||||
|
this->display->setTextSize(2);
|
||||||
|
this->display->setTextColor(WHITE);
|
||||||
|
this->display->print(F("Dist:"));
|
||||||
|
this->display->print(distance);
|
||||||
|
this->display->println();
|
||||||
|
this->display->print(F("Poids:"));
|
||||||
|
this->display->print(poid);
|
||||||
|
this->display->println();
|
||||||
|
this->display->print(F("humi:"));
|
||||||
|
this->display->print(humitemp.substring(0,humitemp.indexOf("/")));
|
||||||
|
this->display->println();
|
||||||
|
this->display->print(F("temp:"));
|
||||||
|
this->display->print(humitemp.substring(humitemp.indexOf("/")+1,humitemp.length()));
|
||||||
|
this->display->println();
|
||||||
|
this->display->display();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void OledScreen::printAmount(int amount) {
|
||||||
|
this->display->clearDisplay();
|
||||||
|
this->display->setCursor(0, 0);
|
||||||
|
this->display->setTextSize(2);
|
||||||
|
this->display->setTextColor(WHITE);
|
||||||
|
this->display->println(F(" Total: "));
|
||||||
|
this->display->println();
|
||||||
|
|
||||||
|
this->display->print(amount / 100);
|
||||||
|
this->display->print(F(","));
|
||||||
|
int centimes = amount % 100;
|
||||||
|
if (centimes < 10) {
|
||||||
|
this->display->print(F("0"));
|
||||||
|
}
|
||||||
|
this->display->println(centimes);
|
||||||
|
this->display->print(F(" EUR"));
|
||||||
|
this->display->display();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void OledScreen::wifiWaiting() {
|
||||||
|
this->clear();
|
||||||
|
this->display->setCursor(0, 0);
|
||||||
|
this->display->setTextSize(2);
|
||||||
|
this->display->setTextColor(WHITE);
|
||||||
|
this->display->println(F("Connection\n"));
|
||||||
|
this->display->println(F(" WiFi...\n"));
|
||||||
|
this->display->println();
|
||||||
|
this->display->display();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OledScreen::clear() {
|
||||||
|
this->display->clearDisplay();
|
||||||
|
}
|
@ -42,6 +42,7 @@ lib_deps =
|
|||||||
adafruit/Adafruit Unified Sensor@^1.1.9 ; adafruit sensor lib (required by DHT11)
|
adafruit/Adafruit Unified Sensor@^1.1.9 ; adafruit sensor lib (required by DHT11)
|
||||||
ericksimoes/Ultrasonic@^3.0.0 ; lib capteur ultra son
|
ericksimoes/Ultrasonic@^3.0.0 ; lib capteur ultra son
|
||||||
bogde/HX711@0.7.5 ; lib pour la balance
|
bogde/HX711@0.7.5 ; lib pour la balance
|
||||||
|
adafruit/Adafruit SSD1306@^2.5.7 ; librairie pour l'ecran oled
|
||||||
; example:
|
; example:
|
||||||
; erropix/ESP32 AnalogWrite@^0.2
|
; erropix/ESP32 AnalogWrite@^0.2
|
||||||
|
|
||||||
|
@ -6,28 +6,45 @@ Program::Program(){
|
|||||||
Serial1.begin(MONITOR_SPEED);
|
Serial1.begin(MONITOR_SPEED);
|
||||||
Serial.begin(MONITOR_SPEED);
|
Serial.begin(MONITOR_SPEED);
|
||||||
|
|
||||||
|
//////Oled Screen/////
|
||||||
|
this->screen = new OledScreen(OLED_WIDTH, OLED_HEIGHT, OLED_RESET);
|
||||||
|
this->screen->wifiWaiting();
|
||||||
|
|
||||||
////////API///////
|
////////API///////
|
||||||
this->api = new API(USER_NAME, USER_PASSWORD, API_HOST);
|
this->api = new API(USER_NAME, USER_PASSWORD, API_HOST);
|
||||||
//this->api->wifiBegin(WIFI_SSID, WIFI_PASSWORD, &Serial1);
|
this->api->wifiBegin(WIFI_SSID, WIFI_PASSWORD, &Serial1);
|
||||||
|
|
||||||
|
|
||||||
//////CAPTEUR/////
|
//////CAPTEUR/////
|
||||||
this->ultrasonic = new Ultrason(ULTRA_SOUND_TRIGD, ULTRA_SOUND_ECHO, "10");//TODO: mettre la valeur en config
|
this->ultrasonic = new Ultrason(ULTRA_SOUND_TRIGD, ULTRA_SOUND_ECHO, ULTRA_SOUND_FULL);
|
||||||
this->dht = new HumiTemp(DHTPIN, DHTTYPE, "20:30/60:80");//TODO: mettre la valeur en config
|
this->dht = new HumiTemp(DHTPIN, DHTTYPE, DHT_FULL);
|
||||||
|
this->balance = new Balance(POID_DOUT,POID_SCK, POID_FULL);
|
||||||
|
this->balance->tar(1077);
|
||||||
|
|
||||||
|
this->screen->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Program::loop(){
|
void Program::loop(){
|
||||||
String distance = this->ultrasonic->read();
|
String distance = this->ultrasonic->read();
|
||||||
String humitemp = this->dht->read();
|
String humitemp = this->dht->read();
|
||||||
|
String poid = this->balance->read();
|
||||||
|
|
||||||
|
|
||||||
|
this->screen->printVal(distance, poid, humitemp);
|
||||||
|
|
||||||
//this->api->sendValue(distance, TRASHCAN_ONE, this->ultrasonic->getValType(), this->ultrasonic->isFull());
|
this->api->sendValue(distance, TRASHCAN_ONE, this->ultrasonic->getValType(), this->ultrasonic->isFull());
|
||||||
Serial.print("Distance in CM = " + distance);
|
Serial.print("Distance in CM = " + distance);
|
||||||
Serial.println(this->ultrasonic->isFull()?" true":" false");
|
Serial.println(this->ultrasonic->isFull()?" true":" false");
|
||||||
|
|
||||||
//this->api->sendValue(humitemp, TRASHCAN_TWO, this->dht->getValType(), this->dht->isFull());
|
this->api->sendValue(humitemp, TRASHCAN_TWO, this->dht->getValType(), this->dht->isFull());
|
||||||
Serial.print("humiTemp = " + this->dht->read());
|
Serial.print("humiTemp = " + humitemp);
|
||||||
Serial.println(this->dht->isFull()?" true":" false");
|
Serial.println(this->dht->isFull()?" true":" false");
|
||||||
|
|
||||||
|
this->api->sendValue(poid, TRASHCAN_THREE, this->balance->getValType(), this->balance->isFull());
|
||||||
|
Serial.print("poid = " + poid);
|
||||||
|
Serial.println(this->balance->isFull()?" true":" false");
|
||||||
|
|
||||||
|
Serial.println();
|
||||||
|
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
@ -1,47 +1,15 @@
|
|||||||
#ifndef TESTING
|
#ifndef TESTING
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
// #include "Program.h"
|
#include "Program.h"
|
||||||
|
|
||||||
// Program* program;
|
Program* program;
|
||||||
|
|
||||||
// void setup() {
|
|
||||||
// program = new Program();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// void loop() {
|
|
||||||
// program->loop();
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
#include "Balance.h"
|
|
||||||
|
|
||||||
Balance *balance;
|
|
||||||
|
|
||||||
void setup(){
|
|
||||||
Serial.begin(MONITOR_SPEED);
|
|
||||||
balance = new Balance(14,15);
|
|
||||||
|
|
||||||
Serial.print("start calibr : ");
|
|
||||||
balance->initCalibration();
|
|
||||||
|
|
||||||
Serial.println("OK");
|
|
||||||
|
|
||||||
// Serial.print("posé poids");
|
|
||||||
// delay(5000);
|
|
||||||
// Serial.println("OK");
|
|
||||||
// balance->calibration(500, MOYENNE_CALIBRATION);
|
|
||||||
// Serial.println("END calibration");
|
|
||||||
|
|
||||||
balance->setCalibrationFact(1077);
|
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
program = new Program();
|
program = new Program();
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop(){
|
void loop() {
|
||||||
// delay(500);
|
program->loop();
|
||||||
Serial.println(balance->getValue());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
Reference in New Issue
Block a user