Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions electrotest/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Denna makefile förutsätter att man har installerat "/usr/local/lib/libcomponent.so"
# vilket man kan göra med kommandon nedan (om man utgår från projekt-rooten dvs katalogen som innehåller katalogerna libpower , libcomponent, libresistance)
# cd libcomponent
# make all
# make install
# ls -l /usr/local/lib/
# (kontrollera att libcomponent.so finns med i katalogen som listades ovan)
# cd ..
# cd electrotest
# make all
# ./electrotest

all:
gcc -std=c99 -o electrotest main/electrotest.c -L. -lcomponent -lm -Wl,-rpath,/usr/local/lib/libcomponent.so
12 changes: 12 additions & 0 deletions electrotest/main/electrotest.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdio.h>

#include "../../libcomponent/main/libcomponent.h"

int main(int argc, char *argv[]) {
printf("\nOm anropet till biblioteket fungerar borde resultat nedan bli: 3 , 1200 , 180 , 18 \n");
float res_array[3];
int count;
count = e_resistance(1398, res_array);
printf("%d , %f , %f , %f \n", count, res_array[0], res_array[1], res_array[2]);
return 0;
}