You are reading a single comment by @allObjects and its replies. Click here to read the full conversation.
  • http://forum.espruino.com/conversations/­297206/

    I like your Roman Numerals...

    If lit at one time, you get 7 messages... 1, 5, 6, 10, 11, 15, 16 If lit

    in sequence, you get some more out of it:
    1 (I,r), 4 (IV,rg), 5(V,g), 6(VI,gr), 9(IX,rb), 10(X,b), 11(XI,br), 14(XIV,brg), 15((XV,bg), 15(XVI,vgr)... to just name the valid Roman Numbers.

    I applied Numerals in Morse Code and used green for good codes throughout the code, and red ones for errors...
    1: .---- 2: ..--- 3: ...-- 4: ....- 5: ..... 6: -.... 7:--... 8: ---.. 9: ---- 0:-----

    (or: all sequences are 5 flashes long; sequences starting with dot/short flash are 1..5,
    starting with long ones are 6 to 9 and 0 (that for sure was defined before digital aera began).

    A logger object that knows when console is available or not understands .err(msgString) and .info(msgString), where msgString is, for example, .----: Connected, prints the msg in console or flashes just the LEDs accordingly (using recursion on string ":"[0]). If you need multi digit messages, blank needs its own interpretation).

    The overall issue though is how you 'delay' application code continuation when using timeouts to do the blinking in order to prevent time-wise overlap of blinking. The code has to be structured accordingly into 'callable' blocks of which the block to be executed next is passed to the logger as well when overlap can be expected.

About

Avatar for allObjects @allObjects started