//ultrasonic sensor #include "NXCDefs.h" #define IN_I2C IN_1 #define INCNT 1 byte writebuf[] = {0x02, 0x42 }; byte readbuf[INCNT]; task main() { int readcnt = INCNT; SetSensorLowspeed (IN_I2C); while (true) { I2CBytes(IN_I2C, writebuf, readcnt, readbuf); ClearScreen(); NumOut(50,20,readbuf[0]); Wait(500); } }