Just realised - it's reset, not unset in Espruino (although unset would probably have made more sense :).
Hmm, I'm not sure about the separate module for PEP. It definitely feels like it should be in a different module, but actually the functions are quite small and there's not much common code - I wonder who'd use two different port expanders in the same project (which would be the only time it really helped).
If not, defining the class in the same file means you could make it faster by 'inlining' MCP32x08.write if you wanted to... for instance:
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.
Just realised - it's
reset
, notunset
in Espruino (althoughunset
would probably have made more sense :).Hmm, I'm not sure about the separate module for PEP. It definitely feels like it should be in a different module, but actually the functions are quite small and there's not much common code - I wonder who'd use two different port expanders in the same project (which would be the only time it really helped).
If not, defining the class in the same file means you could make it faster by 'inlining'
MCP32x08.write
if you wanted to... for instance: