Aswin wrote:1. I have the impression that Lejos drains batteries faster than other firmwares I used. (under comparable condition of course). Can this be true?
Aswin wrote:2. I have some functions that return an array. The array is created within the function. I noticed that other functions, like getData for example update a previously created array as a parameter. I do understand the difference between the two in terms of memory management. I do no know which of the two is the preferred way? In my case the functions are called very frequently, they return arrays of sensor values.
Aswin wrote:3. I see that some classes, like I2CPort, have the parameters for the constructor stored as member variables. Take LEGO_MODE or HIGH_SPEED for example. Why aren't the stored as enums. This would have the advantage that different value of the same parameter are logically grouped. Also, the IDE could benefit from it.
Aswin wrote:4. I think I have made a very nice class to interface accelerometers. It has calibration routines, allows for different units for acceleration (Milli-G, G, m/sec^2, etc) and tilt (radians, degrees, cosine), it has a user interface for calibrating, displaying Sensor values, changing setting etc. It has an abstract class that implements most of this functionality and can be used for every accelerometer. I implemented it for the Mindsensors accelerometer (and a custom one I build). You need to implement just three methods to make it work for any accelerometer. It is well tested.
s.frings wrote:More power consumption is normal.
Lejos runs a virtual machione that interprets Java code. The number of CPU commands per use-case is usually much more than with any other programming language. That's the nature of Java. On PC machines, you might experience much better performance because of the JIT compiler, which does not exist in Lejos. Avoid endless loops, better use events and loops with embedded sleep statements.
Users browsing this forum: No registered users and 1 guest