code compiling, but will not actually work

Yes.
Also it does not write to the sd card either.