my problem is that i would like to outsource the led control to a class. If the code is like below in the main, it works fine. but if it is split into .h, .cpp class, it doe