Skip to content

Commit 9ed7fa1

Browse files
committed
exposing camera option to user in begin() method
1 parent 9e5c012 commit 9ed7fa1

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/OV767X.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ OV767X::~OV767X()
6565
}
6666
}
6767

68-
int OV767X::begin(int resolution, int format, int fps)
68+
int OV767X::begin(int resolution, int format, int fps, int camera_name)
6969
{
7070
switch (resolution) {
7171
case VGA:
@@ -154,7 +154,7 @@ int OV767X::begin(int resolution, int format, int fps)
154154
return 0;
155155
}
156156

157-
ov7670_configure(_ov7670, 1 /*OV7670 = 0, OV7675 = 1*/, format, resolution, 16 /* MHz */,
157+
ov7670_configure(_ov7670, camera_name /*OV7670 = 0, OV7675 = 1*/, format, resolution, 16 /* MHz */,
158158
0 /*pll bypass*/, 1 /* pclk_hb_disable */);
159159

160160
if (ov7670_s_power(_ov7670, 1)) {

src/OV767X.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ enum
3131
GRAYSCALE = 4
3232
};
3333

34+
enum
35+
{
36+
OV7670 = 0,
37+
OV7675 = 1
38+
};
39+
3440
enum
3541
{
3642
VGA = 0, // 640x480
@@ -46,7 +52,7 @@ class OV767X
4652
OV767X();
4753
virtual ~OV767X();
4854

49-
int begin(int resolution, int format, int fps); // Supported FPS: 1, 5, 10, 15, 30
55+
int begin(int resolution, int format, int fps, int camera_name); // Supported FPS: 1, 5, 10, 15, 30
5056
void end();
5157

5258
// must be called after Camera.begin():

0 commit comments

Comments
 (0)