You are reading a single comment by @allObjects and its replies. Click here to read the full conversation.
  • ...since it is a @Gordon/node.js-classical-module-setup, global MPU6050 ('constructor') function is not exposed... in other words, your code is ok to use MPU6050 for the module (singleton) object returned by require(). The module object returned knows only .connect() - a function that then indeed invokes encapsulated/hidden MPU6050(...){...} with new and returns an "MPU6050" instance.

    I do not know the inner workings/details of the driver and the MPU650's behavior, but I would put the .connect(...) and setInterval(...) into an onInit() {...} function to have it also working when saved, disconnected and re-powered, because the - as said - the .connect...() creates the instance and calls initializations within the MPU6050 which for sure will not be saved within Espruino.

    Not soldered pins is not a good idea... (there are special pins that need no soldering but they are hard to use and often break the (thinner) breakout boards...).

    I may understand why you do not want to solder pins the standard way... Depending on how the pins are held in their plastic, you may just solder them in 'the other way round' without pushing them all the way in the the plastic touches the board. After solidly soldering them in, you can remove the plastic by preying gently multiple times on multiple locations. If you are then done with prototyping and you want to solder wires directly (or other final connections), you can take off pin by pin easily.

About

Avatar for allObjects @allObjects started