...yes, but I didn't want to get into the business of having to determine whether the passed pin is a 'real' / built-in pin or an 'imaginary' / portexpander pin... when I can get it 'for free' from you... ;)... last but not least also because typeof 'built-in pin'does NOT return something like "Pin". Of course, I can go after all the other things, but that makes it not universal (built-in Pin class would be a 'reserved word') and, takes away the option to turn just any thing in any fashion into a watchable... (variation of object.on("<eventName>",callback)). Alternative to have a working typeof <built-in pin> could be an extension of E like E.isE(spruino)Pin(<object>). ;):.something else I'd like to get for free... and may get so ;? ...or is it already 'there', and I just don't know about it?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
...yes, but I didn't want to get into the business of having to determine whether the passed pin is a 'real' / built-in pin or an 'imaginary' / portexpander pin... when I can get it 'for free' from you... ;)... last but not least also because
typeof 'built-in pin'
does NOT return something like "Pin". Of course, I can go after all the other things, but that makes it not universal (built-in Pin class would be a 'reserved word') and, takes away the option to turn just any thing in any fashion into a watchable... (variation ofobject.on("<eventName>",callback)
). Alternative to have a workingtypeof <built-in pin>
could be an extension ofE
likeE.isE(spruino)Pin(<object>)
. ;):.something else I'd like to get for free... and may get so ;? ...or is it already 'there', and I just don't know about it?