AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

I2C camera registers / set brigthness manually

The forum is to discuss topics related to robotics, like building robot, controlling it, its software and hardware, etc.

I2C camera registers / set brigthness manually

Postby ntouros » Tue Oct 15, 2013 10:36 pm

hi community,

i am interesting to set brightness mannually in the srv_1 camera.i can prevent the blackfin from automatically adapting to lighting conditions with "vax" command but i want brightness in specific level. I watched the thread below from the oficial srv forum
http://www.surveyor.com/cgi-bin/yabb2/YaBB.pl?num=1276790331 and i am not sure where exactly read/write registers of camera.
i found the address of I2C
I2C address map
http://www.surveyor.com/cgi-bin/yabb2/YaBB.pl?num=1268678898



I am using function I2CReadByte(deviceID,register) aforge
what is the valuse of camera ? deviceID = 0x21 according to map or 0x13 according to thread (admin answer) ? , the registers according to thread is 0x08,0x10 is that right ?

has anyone ever dealt with this?

thank you
ntouros
 
Posts: 24
Joined: Sat Dec 05, 2009 5:23 pm

Re: I2C camera registers / set brigthness manually

Postby ntouros » Wed Oct 16, 2013 1:15 am

Finally after a lot of tests ended in this deviceID = 0x21 and this register =0x10 has the ability to set the brightness in specific level. In my case the camera is Omnivision OV7725 VGA.

For this experiment i used I2CReadByte() everything works perfectly. But when i went to modify this register with my own brightness level in hex value with I2CWriteByte() the srv lost connection every time i try ?

any solution for this ?

thank yoou
ntouros
 
Posts: 24
Joined: Sat Dec 05, 2009 5:23 pm

Re: I2C camera registers / set brigthness manually

Postby ntouros » Wed Oct 16, 2013 2:31 am

i dont know why I2CWriteByte() doesnt work. I make an implementation using this function http://www.aforgenet.com/framework/docs/html/2e6cba87-8787-2179-b20f-549f72c3fb3b.htm and works perfectly.

Here is the code :

//close the auto brightness
sendstr = StrToByteArray("va0");
srv.Send(sendstr);
//change value in register
byte[] sendstrir = new byte[5];
sendstrir[0] = (byte)0x69;//letter i
sendstrir[1] = (byte)0x77;//letter w
sendstrir[2] = (byte)0x21;//deviceID
sendstrir[3] = (byte)0x10;//register
sendstrir[4] = (byte)0x0;//value of brightness
srv.Send(sendstrir);

thank you
ntouros
 
Posts: 24
Joined: Sat Dec 05, 2009 5:23 pm




Return to Robotics

cron