Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter to set delay time in readPicture() #35

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

philrittenhouse
Copy link

This change relates to issue #21. I saw a similar issue where it was necessary to increase the CAMERADELAY value from 10 to 32 in order to successfully read data from the cameras.

Following taf2's suggestion, this pull request adds a parameter to the readPicture() function to allow overriding the default CAMERADELAY value. By default the code will work as before using the CAMERADELAY value of 10. I have also added an error message to help users identify when increasing the delay time may be required.

I haven't been able to find a root cause for why increasing the delay time is sometimes necessary but it has helped in my setup and may help others.

I have tested the changes with my setup (ESP32 and two VC0706 cameras).

Best regards,
Phil


if (!runCommand(VC0706_READ_FBUF, args, sizeof(args), 5, false))
{
Serial.println("VC0706: Read fbuf failed - delay time too small?");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the error condition that the code hits when the delay time is too small, so let the user know what the possible cause is.

@@ -79,7 +79,7 @@ class Adafruit_VC0706 {
boolean TVon(void);
boolean TVoff(void);
boolean takePicture(void);
uint8_t *readPicture(uint8_t n);
uint8_t *readPicture(uint8_t n, uint32_t delay_time = CAMERADELAY);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use CAMERADELAY as the default so that everything works normally if no delay_time value is given.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant