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

Lock does not work immediately after init #9

Open
yaqwsx opened this issue Jul 14, 2021 · 2 comments
Open

Lock does not work immediately after init #9

yaqwsx opened this issue Jul 14, 2021 · 2 comments

Comments

@yaqwsx
Copy link
Member

yaqwsx commented Jul 14, 2021

The following code does not work:

    auto& manager = BlackBox::Manager::singleton();
    manager.init();
    manager.power().turnOn();
    manager.power().turnOn5V();
    manager.lock().init();
    manager.lock().lock();

However, adding a delay helps:

    auto& manager = BlackBox::Manager::singleton();
    manager.init();
    manager.power().turnOn();
    manager.power().turnOn5V();
    manager.lock().init();
    vTaskDelay(1000 / portTICK_PERIOD_MS);
    manager.lock().lock();
    vTaskDelay(1000 / portTICK_PERIOD_MS);
@haberturdeur
Copy link
Collaborator

If both snippets are correct, then it makes sense, because you need to turn on the 5V for the lock to work...

@yaqwsx
Copy link
Member Author

yaqwsx commented Jul 18, 2021

I updated the initial post.

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

No branches or pull requests

2 participants