Testeur.ino 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #include "My_Eeprom.h"
  2. #include <EEPROM.h>
  3. #include "Testeur.h"
  4. void setup() {
  5. Serial.begin(115200);
  6. pinMode(pinBRAS1, INPUT);
  7. pinMode(pinBRAS2, INPUT);
  8. pinMode(pinOSMOL, INPUT);
  9. pinMode(pinCHAUF, INPUT);
  10. pinMode(pinECUME, INPUT);
  11. pinMode(pinREMON, INPUT);
  12. attachInterrupt(digitalPinToInterrupt(pinBRAS1), fc_BRAS1, CHANGE); //CHANGE, RISING,FALLING
  13. attachInterrupt(digitalPinToInterrupt(pinBRAS2), fc_BRAS2, CHANGE); //CHANGE, RISING,FALLING
  14. attachInterrupt(digitalPinToInterrupt(pinOSMOL), fc_OSMO, CHANGE); //CHANGE, RISING,FALLING
  15. attachInterrupt(digitalPinToInterrupt(pinCHAUF), fc_CHAUFF, CHANGE); //CHANGE, RISING,FALLING
  16. attachInterrupt(digitalPinToInterrupt(pinECUME), fc_ECUM, CHANGE); //CHANGE, RISING,FALLING
  17. attachInterrupt(digitalPinToInterrupt(pinREMON), fc_REMO, CHANGE); //CHANGE, RISING,FALLING
  18. }
  19. void loop() {
  20. //analogRead(vent1);
  21. //analogRead(vent2);
  22. delay(5000);
  23. }
  24. void fc_BRAS1() {
  25. if(digitalRead(pinBRAS1)){
  26. Enregistre(BR1ON);
  27. }
  28. else{
  29. Enregistre(BR1OF);
  30. }
  31. }
  32. void fc_BRAS2() {
  33. if(digitalRead(pinBRAS2)){
  34. Enregistre(BR2ON);
  35. }
  36. else{
  37. Enregistre(BR2OF);
  38. }
  39. }
  40. void fc_OSMO() {
  41. if(digitalRead(pinOSMOL)){
  42. Enregistre(OSMON);
  43. }
  44. else{
  45. Enregistre(OSMOF);
  46. }
  47. }
  48. void fc_CHAUFF() {
  49. if(digitalRead(pinCHAUF)){
  50. Enregistre(CHAON);
  51. }
  52. else{
  53. Enregistre(CHAOF);
  54. }
  55. }
  56. void fc_ECUM() {
  57. if(digitalRead(pinECUME)){
  58. Enregistre(ECUON);
  59. }
  60. else{
  61. Enregistre(ECUOF);
  62. }
  63. }
  64. void fc_REMO() {
  65. if(digitalRead(pinREMON)){
  66. Enregistre(REMON);
  67. }
  68. else{
  69. Enregistre(REMOF);
  70. }
  71. }