/************************************************************************/ /* */ /* Program Name: colormap-write.nxc */ /* =========================== */ /* */ /* Copyright (c) 2008 by mindsensors.com */ /* Email: info () mindsensors () com */ /* */ /* This program is free software. You can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; version 3 of the License. */ /* Read the license at: http://www.gnu.org/licenses/gpl.txt */ /* */ /************************************************************************/ /* * History * ------------------------------------------------ * Author Date Comments * Deepak 08/16/08 Initial Authoring. */ #include "nxtcamlib.nxc" const byte sensorPort = IN_1; #define ADDR 0x02 //Print sensor information from its register void ShowSensorInfo(byte prt, byte Addres ) { if( i2cread(prt,Addres,0x00,1)>1) { // sensor name TextOut(0, LCD_LINE8, i2cReadString(prt, Addres, 0x10, 8), false); // sensor firmware version. TextOut(50, LCD_LINE8, i2cReadString(prt, Addres, 0x00, 8), false); } } task main() { byte colormap[48]; int init; init = NXTCam_Init(sensorPort, ADDR); NXTCam_PrepareColormap(colormap, 2, 0,0,0,0,0,0); NXTCam_PrepareColormap(colormap, 3, 0,0,0,0,0,0); //NXTCam_PrepareColormap(colormap, 6, 20,40,0,250,0,255); //NXTCam_PrepareColormap(colormap, 4, 20,40,0,250,0,255); NXTCam_WriteColormap(colormap, ADDR, sensorPort); Wait(1000); }