Author: jsuijs
Date: Fri Oct 24 09:16:47 2008
New Revision: 457
Modified:
trunk/unvalidated/include/peripheral/adc/adc_hardware.jal
Log:
example added
Modified: trunk/unvalidated/include/peripheral/adc/adc_hardware.jal
==============================================================================
--- trunk/unvalidated/include/peripheral/adc/adc_hardware.jal (original)
+++ trunk/unvalidated/include/peripheral/adc/adc_hardware.jal Fri Oct 24
09:16:47 2008
@@ -31,7 +31,28 @@
-- * RE0 = AN5
-- * RE1 = AN6
-- * RE2 = AN7
---
+-- --
+-- --
+-- Example PIC-AD
+-- -- (if you use JALcc, you can copy the complete example below
and "uncomment" it)
+-- -- define the AD converter settings
+-- const ADC_hardware_Nchan = 2 ;number of selected channels
+-- const ADC_hardware_NVref = 0 ;number of external references
+-- const ADC_hardware_Rsource = 10_000 ;maximum source resistance
+-- const ADC_hardware_high_resolution = true ;true = high resolution = 10
bits
+-- ;false = low resolution = 8
bits
+-- -- get the library, after defining the constants
+-- include adc_hardware
+-- --
+-- -- initialize the AD converter according to the above parameters
+-- ADC_init
+-- --
+-- -- now take a sample
+-- -- read high resolution, channel 0
+-- var_word=ADC_read(0)
+-- -- read low resolution, channel 0
+-- var_byte=ADC_read_low_res(0)
+-- --
-----------------------------------------------------------------------------
-- local variables
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---