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.
Fork of prosjektoppgave_alarm by
Diff: main.cpp
- Revision:
- 10:557f325a6119
- Parent:
- 9:7fff168507fa
- Child:
- 11:2af2150e495d
--- a/main.cpp Wed Jan 25 11:41:09 2017 +0000
+++ b/main.cpp Wed Jan 25 11:46:24 2017 +0000
@@ -13,8 +13,8 @@
struct alarmKretser { //1 = aktivert
int A;
int B;
-}
-struct brytere[4]
+};
+struct alarmKretser brytere[4];
int status = 0; //1 = alarm
@@ -34,7 +34,7 @@
}
-void log(int status = 0, int tall1 = 0, char bokstav = "") {
+void log(int status = 0, int tall = 0, char bokstav = '0') {
FILE *fp = fopen("/local/log.txt", "a");
fprintf(fp, "\r\n TIME: %f |", systemTid.read());
switch(status){
@@ -73,22 +73,22 @@
if(volt < bryterABhigh){
bryter = 3;
if (brytere[kretsn-1].A != 1 || brytere[kretsn-1].B != 1){
- log(1,kretsn,"A");
- log(1,kretsn,"B");
+ log(1,kretsn,'A');
+ log(1,kretsn,'B');
}
brytere[kretsn-1].A = brytere[kretsn-1].B = 1;
} else {
bryter = 2;
if ( brytere[kretsn-1].B != 1){
- log(1,kretsn,"B");
+ log(1,kretsn,'B');
}
brytere[kretsn-1].B = 1;
}
} else {
bryter = 1;
if ( brytere[kretsn-1].B != 1){
- log(1,kretsn,"B");
+ log(1,kretsn,'B');
}
brytere[kretsn-1].A = 1;
}
