MAP FUNCTION AND LPD8806

Your code looks fine so I can only assume that the fault is in the library.