Hi, @ash37
To add code please click this link;
Please add it in a NEW post, don't go back and edit old posts.
Can we please have a circuit diagram?
An image of a hand drawn schematic will be fine, include ALL power supplies, component names and pin labels.
Thanks.. Tom..