Loving my BrickPi so far and have got a few simple projects running including some of the samples and am now moving onto some more complex projects.
I’m currently trying to build a robot that can follow a line as a example to some students that we run a programming challenge for using the NXT bots, as a example to what we have planned for next years challenges.
I’m trying to use the the NXT colour sensor to get the light intensity but I have been unable to get any value out that looks like the intensity value using the TYPE_SENSOR_RAW, TYPE_SENSOR_LIGHT_OFF, TYPE_SENSOR_LIGHT_ON, TYPE_SENSOR_COLOR_FULL or TYPE_SENSOR_RCX_LIGHT sensor modes. The only result I got was from TYPE_SENSOR_COLOR_FULL which gave out the value 1, which from what I understood meant it saw black, this was when I was testing with multiple colours. I have also checked the sensor using the NXT block and it seems to still work on that. Is there something I am missing or is this not yet available in the libraries.
I’m currently programming the BrickPi using the C library as that is the one I’m most comfortable with but I am able to switch to one of the other languages if that is what is needed. It is also being powered by both the Micro USB port on the Pi and the 9V input on the BrickPi using 6x1.5V AA batteries. The Sensors I have attached are:
NXT Light Sensor in port 1
NXT UltraSonic Sensor in port 2
NXT Touch Sensor in port 3
3xNXT Motors attached to Ports A, B and C
The code I have so far is available at http://github.com/jamesptanner/BrickPi-LineFollow/blob/master/LineFollow.c
(its probably a little over engineered for what is needed but I’ve been converting code that I had thrown together in the LEGO block language so it made sense to keep the threads in.)