Search under this category:
NXT Repository/Programming/NXT-G/
HiTechnic Acceleration Sensor NXT-G Block
Last update: Friday, March 9th, 2007HiTechnic has released the NXT-G block for the Acceleration Sensor. Plugs are Port, X axis coordinate, Y axis coordinate, Z axis coordinate, Yes/No logic value, Trigger Point, and Greater-than/Less-than.
HiTechnic Color Sensor Block
Last update: Saturday, February 10th, 2007The Color Sensor Block adds support for all Color Sensor features to the LEGO MINDSTORMS NXT Software. This block gives access to features enabling access to Color number, Red, Green and Blue relative color content, and in/out of color range.
HiTechnic Compass Sensor Block
Last update: Saturday, February 10th, 2007The Compass Sensor Block adds support for all Compass Sensor features to the LEGO MINDSTORMS NXT Software. This block gives access to features enabling Compass calibration, target heading and in/out of range and others.
HiTechnic Gyro NXT-G block
Last update: Sunday, August 5th, 2007
This NXT-G block allow you to read degrees per second of rotation using HiTechnic Gyro sensor.
I2C Read/I2C Write General Purpose NXT-G Blocks
Last update: Saturday, February 10th, 2007These two NXT-G blocks published on mindsensors.com website allow low-level I2C read and write operations from within NXT-G.
Line Following NXT-G Block
Last update: Saturday, February 10th, 2007
This block should be placed in a loop, and will cause drive the motors at the speed specified, so the robot can follow the edge of a line, with a single light sensor.
Mask Block for NXT-G
Last update: Saturday, February 24th, 2007
Michael Gasperi created a mask block for NXT-G. This block does bitwise AND between the input (A) and the mask. This is very useful when working with low-level I2C calls where usually each bit means something else…
Download the block from Michael’s site here.
MathScript Block Released
Last update: Monday, October 22nd, 2007
Here’s a new NXT-G block I’ve written for mathematical expressions. The block let’s you wire up to 6 inputs (marked ‘A’ to ‘F’) and write a mathematical expressions (e.g. ‘(A-32)^5/3-B*C’) which can include math operators (+, -, *, /), modulo %, power ^ (only positive integer powers can be calculated) and as many brackets as you like. Notice that the NXT only supports integer math, so 1/2*(A-5)^2 will allways return 0 (since 1 is less then 2) while (A-5)^2/2 will return the correct value (rounded to nearest integer).
A sample program picture is found here.
A forum topic for questions on the new block is found here.
NOTE: this block uses advanced, and undocumented, VI scripting functions to generate efficient LV code encapsulated into an empty template implementation VI. I will post some explentations of the main code part soon.
Memory Level Block
Last update: Thursday, March 22nd, 2007
Here’s a NXT-G sensor block that returns available Flash memory
(in bytes).
Download block here.
Guy Ziv
MinMax NXT-G Block
Last update: Sunday, March 18th, 2007
This small NXT-G allows to get the maximal and minimal value of some varying input. This can be done with NXT-G MyBlocks using variables, but then you can’t easily place more then one such MyBlock in your program (unless you duplicate the block, changing the variable names..). As seen in the above sample code, the MinMax block usually should reside in a loop, and must be “Reset” at the first loop iteration (here I compare the counter to zero). Also, make sure that the input you put in is stable at the first iterations. For example, for the US measurement above I have another Distance Sensor block before the loop to ensure the sensor has enough time to produce meaningful output at the first iteration (otherwise I got maximal distance of 100 inches regardless of what I tried to do to the US sensor…). The block can be downloaded here.
Motor Power Meter NXT-G Block
Last update: Sunday, March 18th, 2007
This block is a “sensor” which allows you to monitor the actual power sent to the NXT servo motor. In a single motor mode (Motor block) with “Motor Power” enabled the firmware automatically increases the power to keep constant speed. Monitoring the ”Actual Power” allows detecting stall conditions as well as slip conditions (e.g. when your robot hits the wall, its motors might still be able to slip in place but the robot does not move). The former condition can be detected using encoders (as previously shown by Brian Davis and Dick Swan), but slipping can’t. Nevertheless, the actual power during slipping will be larger then the set power. The same goes for 2 motor “Move” command.
Usage: look for the typical min/max value of Actual Power during regular operation. Use the previously published MinMax Block to do this. Then set the threshold to a value larger then the maximal value rechieved during operation (I found 10-15% extra power is sufficiently discriminating and gives little false positive readouts). You can also monitor the difference (i.e. Actual Power - Set Power). Complete stall conditions for a single motor (with Motor block) are detected as “Actual Power” > 99.
NOTE: The NXT internal Power values are signed, where the sign defines the direction of motion. This block ignores the sign and allways returns positive values.
Download the block here.
MotorMux NXT-G Block
Last update: Saturday, February 10th, 2007NXT-G Block for mindsensors.com motor multiplexer (MOTORMX-Nx).
PCF8574 Kit NXT-G block
Last update: Sunday, April 15th, 2007
Mindsensors.com released this NXT-G block to communicate with the PCF8574-Nx solder-it-yourself prototyping sensor. This IC gives 8 digital inputs/outputs.
Pneumatic Pressure Sensor NXT-G Block
Last update: Wednesday, February 14th, 2007NXT-G Block for mindsensors.com Pneumatic Pressure Sensor (PPS35-Nx).
Any additions/suggestions/comments? Send an email to repository@nxtasy.org.
Search
Categories
Monthly Archives
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006