Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp
- Committer:
- tors
- Date:
- 2015-01-28
- Revision:
- 0:549a6a40f7d8
File content as of revision 0:549a6a40f7d8:
#include "mbed.h"
BusOut ALARM14(LED1,LED2,LED3,LED4);
BusOut ALARM58(p21, p22, p23, p24);
DigitalOut NORMAL(p25);
AnalogIn SONE12(p17), SONE34(p18), SONE56(p19), SONE78(p20);
DigitalOut BRYTER(p15); //=Innelåst servicebryter.
void alarmTest (void)
{
if(v == 4.19)
{
ALARM14 = 1;
ALARM58 = 1; //Spenning A+B
}
if(v == 6.765)
{
ALARM14 = 1;
ALARM58 = 0;
}
if(v == 5.478)
{
ALARM14 = 0;
ALARM58 = 1;
}
else
ALARM14 = 0;
ALARM58 = 0;
}
int main()
{
float v;
while(1)
{
alarmTest
if(SONE12 >= 3.63 && SONE12 <= 6.93)
{
if (ALARRM14 & 1 == 0)
ALARM14 += 1;
}
if(SONE34 >= 3.63 && SONE34 <= 6.93)
{
if (ALARM14 & 2 == 0)
ALARM14 += 1;
}
if(SONE56 >= 3.63 && SONE56 <= 6.93)
{
if(ALARM58 & ? == 0)
ALARM58 += 1;
}
if(SONE58 >= 3.63 && SONE58 <= 6.93)
{
if(ALARM58 & ? == 0
ALARM58 += 1;
}
}
}