Hi,
SampleADC
The Chip samples the analogue input and stores the value in memory.
Where in memory? Why would you use this, normally you would manipulate data after reading the sample. Since we have the INT Read & BYTE Read to move values into memory so we can manipulate them, when would the SampleADC command be used?
INT ReadValueAsInt
Returns the full analogue value as a INT value.
Note: The value can be 8 bit, 10 bit or greater depending on the specific device used. Please refer to the device datasheet for full details.
Does the INT ReadValueAsInt do the SampleADC or must you do the SampleADC then the INT ReadVauleAsINT macro?
BYTE ReadValueAsByte
Returns the 8 most signifiicant bits of the analogue value as a BYTE value.
The resulting value 0-255 can be easier to work with in some instances (e.g. output to a port, ) than the the full INT value.
Does the BYTE ReadValueAsInt do the SampleADC or must you do the SampleADC then the BYTE ReadVauleAsINT macro?
Thanks
Ron
ADC component macro Questions
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello
You must always do a sample ADC before you perform a read. The sample ADC takes a reading of the analogue voltage and stores the result into two 8 bit registers inside the PICmicros memory. The read functions simply get hold of this result.
You must always do a sample ADC before you perform a read. The sample ADC takes a reading of the analogue voltage and stores the result into two 8 bit registers inside the PICmicros memory. The read functions simply get hold of this result.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel