User Functions:

nxt_connect(struct nxt_remote *nxt_user)
nxt_motor(int port, int speed, int brake)
nxt_motor_rotate(int port, int speed, int degrees)
nxt_setsensor(int port, int sensortype, int sensormode)
nxt_getsensor(int port)
nxt_printmess()
nxt_disconnect()
nxt_gettacho(int port)
nxt_motor_zero()

Internal functions:

NXT_send(unsigned char *message, int length)
NXT_receive(unsigned char *rcbuf, unsigned long length)
NXT_open(char *portname)
NXT_updateinputtypemode(unsigned char inputnr)
NXT_setultrasonic(unsigned char inputnr)
NXT_stopultrasonic(unsigned char inputnr)
NXT_getultrasonicvalue(unsigned char inputnr)
NXT_getultrasonicvaluefast(unsigned char inputnr)
NXT_initinput(unsigned char inputnr)
NXT_pollinput(unsigned char inputnr)

Variables:

Type:Name:Description:
Internal:
charportname[6]Holds COM port name used to connect.
unsigned charmess[256]Holds message sent to or recieved from NXT.
unsigned charnxtname[15]Holds name of the NXT.
unsigned charbtaddress[8]Holds Buletooth adress.
inti_readyNot used?
intNXT_stopNot used?
intNXT_errorHolds Error returned my NXT.
Motor:
intNXT_motoron[3]Holds Motor state (1 or 0).
doubleNXT_motor_pos_raw[3]Holds Motor tachometer position.
doubleNXT_motor_pos_cum[3]Holds Motor tachometer count since program start.
Sensor:
intNXT_sensoron[4]Holds Sensor state(1 or 0).
intNXT_sensortype[4]Holds new Sensor type.
inti_sensortype[4]Holds last set Sensor type.
intNXT_sensormode[4]Holds new Sensor mode.
inti_sensormode[4]Holds last set Sensor mode.
intNXT_sensorvalraw[4]Holds last Sensor reading.
intNXT_sensorvalnorm[4]Not implimented

Enumerations:

Name:Value:Description:
Motor:
Motor Port:
PORT_A0 
PORT_B1 
PORT_C2 
Motor Mode:
RUN_IDLE0Sets operation to run, idle.
RUN_BRAKE1Sets operation to run, brake.
OFF_IDLE3Sets operation to off, idle.
Sensor:
Sensor Ports:
PORT_10 
PORT_21 
PORT_32 
PORT_43 
Sensor Types
TOUCH1Sets to Touch sensor.
TEMPERATURE2Sets to Temerature Sensor.
LIGHT_ACTIVE5Sets to Light Sensor in active mode(LED on).
LIGHT_INACTIVE6Sets to Light Sensor in inactive mode(LED off).
SOUND_DB7Sets to Sound Sensor in dB.
SOUND_DBA8Sets to Sound Sensor in dBa.
ULTRASONIC11Sets to Ultrasonic Sensor.
Sensor Mode:
RAWMODE0 
BOOLEANMODE50