void loop ()
uint32_t now = pros::millis();
if (joy1->get_digital(DIGITAL_A)) //if i don't pressed DIGITAL_A ,the loop() will stop?
mutex.take(10); // if out of time he will cout << last a?
Vision debugging is very, very cumbersome.
I plan to write a convenient debugging tool for students.
Vision is a separate thread whose loop time is controlled at 20 ms
But the lvgl thread cycle time is 100 ms.
I plan to use mutexes to solve the asynchronous problem.
But he always breaks down.I’m analyzing the reasons.
Not sure if your early school teachers did this, but imagine a classroom where you’re having a discussion. Only one student is allowed to speak at a time, and that student is determined by whomever is holding a designated ball. Students can request the ball. If they get the ball, they can give it up and let someone else take it.
You can think of a mutex operating in a similar manner. I’ll try to type up a more concrete example if you need it when I get to my computer (and not my phone).
My home computer does not have their source code. Many of them are just pseudo-codes that I temporarily simulate. My English is not very good. Sometimes I feel that the code can be expressed more clearly.