So from the code and your statement it looks like either the first "if startbutton = 1 then goto checkvalues" is reading incorrectly; or perhaps the first "flashingled = 0" is not being executed.
Your initial settings look fine. You can remove the ADCON1 as this chip does not have this. I would perhaps have the order different (i.e. @device first), but I do not think it should make a difference.
How is the "startbutton" input connected? Is it sharing anything with the solenoid?
How is the "flashingled" connected?
If you disconnect the solenoid output, does the code runs as expected?
Bookmarks