What code? You need to post it for anyone to be able to comment on it!
This will help: "How to get the best out of this forum " - in particular, " Posting code and common code problems"
R4, or R3 (or earlier)? They are very different!
Please also post your schematic, and some good, clear photos of your setup.
See: " Schematics or circuit diagrams" in the above post.
You've marked this as 'Solved' - but it seems that is not the case?