What is your analog source?
Can you post a schematic and your current code?