05-29-2007 11:49 AM
05-30-2007 11:26 PM
in my project I will create a sensor block to be imported into NXT software for a RGB color sensor, which would have to use both of the two digital pinsCould some one tell me how to control the ultrasonic sensor by using those two digital pins and how does the corresponding sensor block look like?
Whether you're creating a device to connect to "the Brick", or understanding how the Ultra-sonic sensor is used, it would probably be good to understand the I2C protocol. The attached pdf from Phillips is pretty thorough, though there are more "friendly" instructions on the web.
Basically the Brick, acting as I2C master, tells an I2C slave to send some data; the master (Brick) also supplies the "clocks" for the data transfer.
For development, an oscilloscope will be very helpful - a logic-analyzer works well too.
Cheers!
05-31-2007 09:09 AM
thanks for your advice, tbd ! Acturally, I want to connect a new developed RGB color sensor onto the NXT brick. You are right. I have to make it clear, how NXT brick works with sensors by using I2C protocol.
06-04-2007 01:09 PM
06-05-2007 05:00 AM
Hi Indianna,
I'm still wondering, wether there're functions avaiable for the digital pin control
Do you want to control the brick's port-pins like individual digital-IO lines? If so, I don't know how - maybe some kind soul will help!
Note: The NXT-toolkit NXTSystemCall method: NXTCommLSWrite perfoms the two most fundamental I2C Write and Read operations. NXTCommLSWrite performs an I2C write if "ReturnLength" is 0. NXTCommLSWrite performs an I2C read if ReturnLength > 0 (NXTCommLSRead accesses the NXT's input buffer.)
Cheers!