Loginskip to content

NXT Repository/Programming/

Here you will find contributed NXT programs, NXT-G MyBlocks, NXT-G extension blocks, NBC codes, RobotC codes etc.

Search under this category:

Sub-categories:

  • Math related (4)
  • Alt.NXT-G (20)
  • NXT-G (41)
  • Contributions:

    HiTechnic Digital Compass driver for RobotC

    Last update: Sunday, October 8th, 2006

    I’ve written a simple device driver for the HiTechnic digital compass sensor. The driver hides all hardware details (i.e. I2C communication) from the user, allowing easy integration of the new sensor into existing programs. It polls the sensor reading every 5ms into the standard sensor variables SensorRaw and SensorValue.

    (more…)

    Making Music With NXT Melodies

    Last update: Tuesday, October 24th, 2006

    Introduction

    I want to first thank Eric and Guy for letting me join the nxtasy team. I’ve been impressed for quite some time by the amazing content and community being built here and I wanted to be a small part of it.

    And now on to the subject at hand - making music!

    Playing Sounds

    A very popular feature of the standard NXT firmware is the ability to play wave files which have been converted into NXT sound files (with an .rso extension). The NXT software comes with many sounds which can be used in an NXT-G or NBC program with the standard NXT firmware to make your robot sound cool. Using a wave file to NXT sound file conversion utility you can easily create additional sounds for use in NXT-G and NBC programs.

    Unfortunately, even though NXT sound files are fairly low quality (8-bit, mono, 8k sample rate) sounds, they can take up large amounts of flash memory when they are used in a program. The “Writing Efficient NXT-G Programs” pdf document on the First Lego League website recommends that you “minimize use of Sound and Display blocks” in order to more optimally use the available flash memory. With flash memory limited to around 128 kilobytes it can be very important to pay close attention to how much space is taken up by sound files.

    (more…)


    Any additions/suggestions/comments? Send an email to repository@nxtasy.org.