Skip to main content

Posts

Showing posts with the label integer

NXT Area and Volume Calculator

This NXT Area and Volume Calculator is a little math exercise for your NXT, which gets it to act like an electronic "rolling tape" measuring device, to calculate length, area, and volume in both metric and English units. As some of you may know, the new NXT-G 2.0 software from LEGO Education has added support for "floating point" (non-integer decimal numbers such as 12.3) numbers and math. I was pondering what this meant for users of the existing NXT-G 1.x software, which only supports integer numbers and integer math. So I decided to cook up a little exercise to do some math that could benefit from floating point, but still done the integer way, so the program for this project will work in either NXT-G 1.X or 2.0. For those interested, here is a brief summary of some of the issues. A basic technique of integer math is to pay attention to the order of operations and store results scaled up in precision if necessary. For example, if there are 2.54 cm per inch, how ...