Skip to content

Commit 5af0bd7

Browse files
authored
Merge pull request #827 from sebromero/sebromero/ov-flip-mirror
Implement vflip and mirror for OV cameras
2 parents f2af60a + 43c0573 commit 5af0bd7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libraries/OV7670/ov7670.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,12 +699,16 @@ int OV7670::setFrameRate(int32_t framerate)
699699

700700
int OV7670::setVerticalFlip(bool flip_enable)
701701
{
702-
return -1;
702+
uint8_t currentRegisterValue = regRead(getID(), MVFP);
703+
uint8_t newRegisterValue = flip_enable ? currentRegisterValue | MVFP_VFLIP : currentRegisterValue & ~MVFP_VFLIP;
704+
return regWrite(getID(), MVFP, newRegisterValue);
703705
}
704706

705707
int OV7670::setHorizontalMirror(bool mirror_enable)
706708
{
707-
return -1;
709+
uint8_t currentRegisterValue = regRead(getID(), MVFP);
710+
uint8_t newRegisterValue = mirror_enable ? currentRegisterValue | MVFP_MIRROR : currentRegisterValue & ~MVFP_MIRROR;
711+
return regWrite(getID(), MVFP, newRegisterValue);
708712
}
709713

710714
int OV7670::setResolution(int32_t resolution)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy