TRIAC dimmer with different codes

It might help if you posted your schematic and code. Without that, there is no help to be given. There are so very many things that can go wrong with a triac dimmer.