diff --git a/electrotest/Makefile b/electrotest/Makefile new file mode 100644 index 0000000..cb0062d --- /dev/null +++ b/electrotest/Makefile @@ -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 diff --git a/electrotest/main/electrotest.c b/electrotest/main/electrotest.c new file mode 100644 index 0000000..9a8130b --- /dev/null +++ b/electrotest/main/electrotest.c @@ -0,0 +1,12 @@ +#include + +#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; +}