Skip to content

Commit

Permalink
near mode registers
Browse files Browse the repository at this point in the history
  • Loading branch information
dongxu committed Mar 8, 2012
1 parent 923b039 commit 5cb5051
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/cameras.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,11 +999,25 @@ int freenect_start_depth(freenect_device *dev)
break;
}
write_register(dev, 0x13, 0x01);
write_register(dev, 0x14, 0x1e);
write_register(dev, 0x14, 0x1e);

write_register(dev, 0x06, 0x02); // start depth stream
write_register(dev, 0x17, 0x00); // disable depth hflip

dev->depth.running = 1;

//near/far mode
write_register(dev, 0x15, 0x1e); //register not determined
usleep(100000); //sleep 0.1 seconds
#ifdef NEAR_MODE
//near mode
write_register(dev, 0x2ef, 0x190); //near mode: register 2EF set to 0x190= 400 millimeter
#else
//far mode
write_register(dev, 0x2ef, 0x320); //near mode: register 2EF set to 0x320= 800 millimeter
#endif
usleep(100000);

return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions src/cameras.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include "libfreenect.h"

#define NEAR_MODE

// Just a couple function declarations.

// These are called by core.c to do camera-specific initialization that needs
Expand Down

0 comments on commit 5cb5051

Please sign in to comment.