ina219 #1056
Replies: 5 comments
-
Posted at 2020-07-12 by parasquid I probably need help in fully converting this into a module. Copy pasting into the left hand side as suggested in https://www.espruino.com/Writing+Modules works and I'm able to get the sample code working. However, doing a
gives some tokenization errors depending on whether or not I have minification turned on. Disabling all options for minification now gives me
I'm not really sure where I'm tripping up :( |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-07-12 by parasquid It looks like after I converted the arrow functions into the old ES5 syntax, things are working again :D |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-07-12 by parasquid However, enabling the
I'm not sure if being able to be pretokenised is a requirement for getting a module merged though. If so, I'd appreciate any hints on how to debug them (as copy-pasting the code on to the IDE seems to work just fine and I'm unable to reproduce the error) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-07-13 by @gfwilliams Thanks! This looks great - just merged and should go live in the next day or so. I wouldn't worry about the pretokenisation - I'm not actually sure why it'd be giving you any problems, but it might be combination of that and minification.
Yeah, this is actually a common thing with arrow functions. They store
(Having said that I did notice a bug in Espruino's arrow function implementation which I'll have to get fixed) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-07-13 by 4thex In general I try to stay away from using |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-07-12 by parasquid
I had a small project in Arduino that used the INA219 and I thought I'd port it over to Espruino so I can more easily to prototype development.
I found that while there is a module for the INA226 there isn't for the INA219 so I thought I'd take a stab at making a module for it: espruino/EspruinoDocs#562
It's my first time contributing an actual module to Espruino, so feedback would be greatly appreciated :)
Also big thanks to Ákos Lukács who apparently made the INA226 from which I took major inspiration from :)
Beta Was this translation helpful? Give feedback.
All reactions