this code works but if you change the input port of the a/d convertor and then add a pause in the line between changing and a/d conversions start then it stucks.
example:
Code:'retrieve sound level ADCON0.5 = 0 ADCON0.4 = 0 ADCON0.3 = 0 pause 50 AD_Progress = 1 while AD_Progress = 1: wend Sound_Level.lowbyte = ADRESL Sound_Level.highbyte = ADRESH 'retrieve negative level ADCON0.5 = 0 ADCON0.4 = 0 ADCON0.3 = 1 pause 50 AD_Progress = 1 while AD_Progress = 1: wend Negative_Voltage.lowbyte = ADRESL Negative_Voltage.highbyte = ADRESH 'retrieve positieve level ADCON0.5 = 0 ADCON0.4 = 1 ADCON0.3 = 0 pause 50 AD_Progress = 1 while AD_Progress = 1: wend Positive_Voltage.lowbyte = ADRESL Positive_Voltage.highbyte = ADRESH




Bookmarks