I have write this for splitter, but it dosen'n work.
I use the eclips.
import java.lang.Object.*;import lejos.nxt.addon.*;import lejos.nxt.*;public class splitter { byte[] newAddress = {(byte) 0xA0, (byte) 0xAA, (byte) 0xA5, (byte) 0x04};
I2CSensor s1 = new I2CSensor(SensorPort.S1);
public void sendData(){ s1.sendData(0x41, newAddress, 4);}
public void UltrasonicSensor(){ UltrasonicSensor sonic = new UltrasonicSensor(SensorPort.S1);sonic.setAddress(0x04); }
public void LightSensor(){ LightSensor ls = new LightSensor(SensorPort.S1);ls.setAddress(0xAA); }
public void CompassSensor(){ CompassSensor cs = new CompassSensor(SensorPort.S1);cs.setAddress(0xA5); } }
so, kan somebody tell me what's fout.
P.S. I'm sorry my nootbook cannot type chineese.
thank you. |