![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
06.03.2018
Fork of Alarmsystem_med_matrix_log_funker_ikke by
Diff: main.cpp
- Revision:
- 3:26a7b2c4bed1
- Parent:
- 2:cef96d07d3cd
- Child:
- 4:aa2cff91ff4f
--- a/main.cpp Tue Jan 30 08:24:55 2018 +0000 +++ b/main.cpp Tue Jan 30 10:00:04 2018 +0000 @@ -1,12 +1,10 @@ #include "mbed.h" -#define Feil 0 -#define Tilstand1 (0.9<1.5) -#define Tilstand2 (2.2<2.8) -#define Tilstand3 (3<3.3) -#define Normaldrift (0.01<0.2) - -#define _1MIN 600 +#define Feil 0<1 +#define Tilstand1 2.5<2.7 +#define Tilstand2 2.1<2.3 +#define Tilstand3 3.3 +#define Normaldrift 1.8<2.0 DigitalOut Driftslys(LED1); BusOut AlarmUtganger1(p21, p22, p23, p24); @@ -25,7 +23,6 @@ volatile int Utganger1 = AlarmUtganger1; volatile int Utganger2 = AlarmUtganger2; volatile int Bryter = Servicebryter; -void Alarmf(void); //Funksjon for og pluss sammen bussen til alarmene volatile int Door1_1 = 0, Door1_2 = 0, Door2_1 = 0, Door2_2 = 0, Door3_1 = 0, Door3_2 = 0, Door4_1 = 0, Door4_2 = 0; volatile float Sone1 = _Sone1 * 3.3; volatile float Sone2 = _Sone2 * 3.3; @@ -74,30 +71,30 @@ for(i = 0; i < 3; i++) { if(ArrSone[i] == Tilstand1) { AlarmBlink_Start(); - DoorOne[i] = Utganger1; + DoorOne[i] = AlarmUtganger1; } if(Tilstand2 == ArrSone[i]) { AlarmBlink_Start(); - DoorTwo[i] = Utganger2; + DoorTwo[i] = AlarmUtganger2; } if(Tilstand3 == ArrSone[i]) { AlarmBlink_Start(); - DoorOne[i] = Utganger1; - DoorTwo[i] = Utganger2; + DoorOne[i] = AlarmUtganger1; + DoorTwo[i] = AlarmUtganger2; } if(Feil == ArrSone[i]) { AlarmBlink_Start(); } if(Normaldrift == ArrSone[i]) { Driftslys = 1; - DoorOne[i] = Utganger1 - DoorOne[i]; + DoorOne[i] = AlarmUtganger1 - DoorOne[i]; } if(i < 0 ) { - DoorOne[i] = Utganger1 + DoorOne[i]; - DoorTwo[i] = Utganger2 - DoorTwo[i]; + DoorOne[i] = AlarmUtganger1 + DoorOne[i]; + DoorTwo[i] = AlarmUtganger2 - DoorTwo[i]; } if(i < 0 ) { - DoorOne[i] = Utganger2 + DoorTwo[i]; + DoorOne[i] = AlarmUtganger2 + DoorTwo[i]; } } return ArrSone[i], DoorOne[i], DoorTwo[i];