Interfacing The TrinfactorGP With the RCX Brick
Once all the connections are created as in the connection diagram, the TrinfactorGP is ready for the use. The next step is to program the RCX brick using any programming language that it supports (IC, NQC, C++, Visual Basic…) so it reads the analog port where the TrinfactorGP is connected to.

Following is the simple IC code which can be used to test the sensor which is connected into the analog port 1 of the RCX brick:
----------------------------------------------------------------------------------------------------------
void main()
{
int sensor_reading;  //variable for storing the current sensor reading

while(1)  //infinite loop to obtain continious sensor readings
{
  sensor_reading = light(1);  //reading the sensor at analog port 1
  printf("Port 1 = %d", sensor_reading);  //display sensor value on the LCD
  msleep(100L);  //wait for 100 milliseconds for observing the value on LCD
}  //end of infinite loop
}  //end of main function
----------------------------------------------------------------------------------------------------------

Click to Go Back To TrinfactorGP Manual Page One
Click To Go Back To The TrinfactorGP HomePage