Welcome to the forum
Please post your code here, using code tags when you do
What is the purpose of the 1K resistor ?