Hi,
I have been using Lejos for two months now. I like it a lot! Compared to robotC, where I came from, it allows for better structured programs. While learning the language I collected some unrelated questions.
1. I have the impression that Lejos drains batteries faster than other firmwares I used. (under comparable condition of course). Can this be true?
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.
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.
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.
I would like to make this available to others. Is there any interest in this? If so, how can I make it part of Lejos?
