On 8 Oct 2008, at 08:36 , Joep Suijs wrote:

>
> A new thread for this issue that came up:
>
> 2008/10/8, Sebastien LELONG <[EMAIL PROTECTED]>:
>>
>>> With the explicit call of setup, you touching that other to-be
>>> discussion again (should setup be called at include-time? And  
>>> maybe we
>>> should have a naming convention for the init/setup function).
>>
>> Yes, this is worth another discussion.
>
> In lcd_dh44780_4, init is called when the library is included. In
> adc_hardware it is not, so the user must call it after the include.
> Why this difference?

The LCD should be initialised for it to function. This takes time as  
well.

The ADC can be switched on and off quickly with no delay. There is no  
"setup". There is a setup of aquisition time, which is done by  
calling the lib.


> Call at include-time ensures the init can not be forgotten, which is a
> good thing.
I agree.

> Not calling it at include time seems to give more flexibility. But I
> can't think of a practical situation where one would need this kind of
> flexibility.
Me neither.

Things as basic as an LCD should be very simple, like:

> var  bit  LCD_RS        is pin_b5       -- LCD command/data select.
> var  bit  LCD_EN        is pin_b4       -- LCD data trigger
> var byte  lcd_data_port is portb_low    -- LCD data
> portb_direction     = all_output    -- LCD data is portb_low
>
> include lcd_hd44780_4               -- LCD library with 4 data lines
> include print                       -- output library
>
>
> const byte str1[] = "Hello world"   -- define a string
> print_string(hd44780, str1)             -- output string to LCD

more difficult functions like i2c could have more flexibility.


---
ir EE van Andel [EMAIL PROTECTED]  http://www.fiwihex.nl
Fiwihex B.V. Wierdensestraat 74, NL7604BK Almelo, Netherlands
tel+31-546-491106 fax+31-546-491107



--~--~---------~--~----~------------~-------~--~----~
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