Hi. That's a very good point. Espruino can use inheritance, but as you say I'm not using it in the modules. As it is, the 'getTemp' method will be redefined for each call to connect.
It'd be a really good idea to re-write them in such a way that the functions could be re-used. Could you paste up what you think a better version of the DS18B20 module would be? It'd be nice to re-arrange the existing modules while there aren't that many of them :)
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.
Hi. That's a very good point. Espruino can use inheritance, but as you say I'm not using it in the modules. As it is, the 'getTemp' method will be redefined for each call to connect.
It'd be a really good idea to re-write them in such a way that the functions could be re-used. Could you paste up what you think a better version of the DS18B20 module would be? It'd be nice to re-arrange the existing modules while there aren't that many of them :)