Skip to content

Commit

Permalink
Merge pull request #827 from sebromero/sebromero/ov-flip-mirror
Browse files Browse the repository at this point in the history
Implement vflip and mirror for OV cameras
  • Loading branch information
sebromero authored Jan 18, 2024
2 parents f2af60a + 43c0573 commit 5af0bd7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libraries/OV7670/ov7670.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,12 +699,16 @@ int OV7670::setFrameRate(int32_t framerate)

int OV7670::setVerticalFlip(bool flip_enable)
{
return -1;
uint8_t currentRegisterValue = regRead(getID(), MVFP);
uint8_t newRegisterValue = flip_enable ? currentRegisterValue | MVFP_VFLIP : currentRegisterValue & ~MVFP_VFLIP;
return regWrite(getID(), MVFP, newRegisterValue);
}

int OV7670::setHorizontalMirror(bool mirror_enable)
{
return -1;
uint8_t currentRegisterValue = regRead(getID(), MVFP);
uint8_t newRegisterValue = mirror_enable ? currentRegisterValue | MVFP_MIRROR : currentRegisterValue & ~MVFP_MIRROR;
return regWrite(getID(), MVFP, newRegisterValue);
}

int OV7670::setResolution(int32_t resolution)
Expand Down

0 comments on commit 5af0bd7

Please sign in to comment.