2008/10/24, Rob Hamerling <[EMAIL PROTECTED]>: > > > I tried to use the ADC-hardware library, and it didn't become happy! Stef had the habit of adding an ready_to_copy example include. From the orginal file is below. This seems to be lost in the jallib-isation.
Joep -- ----------------------------------------------------------------------------- -- ----------------------------------------------------------------------------- -- ----------------------------------------------------------------------------- -- <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) -- ----------------------------------------------------------------------------- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
