Ok, well let's get a actual blink library first before we implement it
into debug :)

If the led lib goes into debug lib, procedure names would be similar
to how I implemented print lib.

Matt.

On Oct 4, 6:16 pm, Sebastien Lelong <[email protected]>
wrote:
> Hi Matt;
>
> 2010/10/2 mattschinkel <[email protected]>
>
> > I have suggested a led_blink library in the past, it was small and not
> > so useful. We should create one that can make various patterns on one
> > or more led's. I think some may disagree about this led library if
> > there are blocking delay's. Should we use blocking delays or a timer
> > interrupt? or maybe add a constant so the user may choose?
>
> Yes, but non-blocking delays can cause superpositions of LED patterns, it
> may also confuse users when "reading" the message ?
>
>
>
> > I think the proper syntax would be:
> > debug_led_strobe(pattern_led_0,debug_level)
>
> I'm not sure to agree, for me, strobe is part of the message, not the
> function name. If you use PWM on the LED, there's no strobe anymore (ok
> that's a special case). So, as for me, strobe is described within the
> message. Keeping a print-like API, ie. print(device,message),
>
> debug_led(the_led,message), where the_led is a pattern parser acting on a
> LED
>
> or, maybe,
>
> debug_led(message_parser,the_led,message), so the parse, the LED and the
> message are decoupled.
>
>
>
> > To make numbers/debug levels on led's, you could do binary where a
> > short pulse is a 0 and a long pulse is a 1. so the number 2 would be
> > LONG .... SHORT. and possibly separate numbers with a very short pulse
>
> Decomposing the problem, I see a language which can be used with LEDs, a way
> to interpret this language (print), and then in a debugging context (debug):
>
>   - language: Morse ? 0=short, 1=long, what about delay duration ? I don't
> see to code delays. How would you code 3 flashing lights, then nothing for a
> while, then 2 flashing lights ? There's also this language used by LED
> driver LP5523, explained here:http://wiki.maemo.org/LED_patterns. A little
> bit advanced (and applying mostly to RGB LEDs) but interesting too.
>
>   - depending on the language, you select the appropriate parser. It can be
> "guessed" with some user-defined constants.
>
> const USE_MORSE = 1
> include led
> -- lib knows it has to select Morse parse
>
> I think basic usage should hide parser selection, but API should also allow
> user to select different "language"
>
> Just some (almost) random thoughts...
>
> Cheers,
> Seb

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