set_analog_pin(3)

On Aug 21, 1:55 am, funlw65 <[email protected]> wrote:
> You don't need adc_nchannels. Is all in the second case/example from
> the blog.
> When analog pins are independent of each other, you need only to
> specify the resolution (8 or 10bit, respectively false or true) and to
> set which pin is set as digital with set_analog_pin(x). And if you
> have a vref or not, of course.
>
> -- first, set all as digital, then
> -- now configure ADC
> const bit ADC_HIGH_RESOLUTION = false
> const byte ADC_NVREF = 0
> -- we can't specify a number of ADC channel here,
> -- or we'll get an error !
> include adc
> adc_init()
> -- now we declare the pin we want as analog !
> set_analog_pin(0)  -- RA0/AN0
> set_analog_pin(4)  -- RA4/AN4
> set_analog_pin(5)  -- RB6/AN5
>
> Rob Hamerling ::
>
> > Hi Seb,
>
> > I've tried to understand how to work with the ADC by reading the blog,
> > some of the samples and the html docs. But I'm afraid it is rather foggy.
>
> > I want to build a single channel dimmer with a 12F683: a potmeter on
> > GP4/AN3 and PWM output on GP2/CCP1. Should be simple!
>
> > It is not clear to me if I have to specify adc_nchannel is 1 or 4. I
> > suspect I need 4 (since I use AN3), but how to 'get back'
> > GP0/AN0..GP2/AN2 for other work?
>
> > I cannot get rid of a compile error:
>
> > k:/jallib/include/peripheral/adc/adc_clock.jal:149: "jallib_adcs" not
> > defined
>
> > I've browsed the ADC libs but I could not find a reference to the
> > 12F683. It is supposed to be supported?
>
> > It would be nice if you could provide me with an elementary setup!
>
> > Regards, Rob.
>
> > --
> > Rob Hamerling, Vianen, NL (http://www.robh.nl/)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to