MATLAB Answers

Run Two Function (inshow & listening Serial port Arduino) Simultaneously

2 views (last 30 days)
Khoa Ho
Khoa Ho on 7 May 2019
Answered: Khoa Ho on 21 Jun 2019
I wrote a program RFID Read When the Card Touch, then process image get from snapshot.
I use while loop to get snapshot from webcam/ipcamera and show it on axes. But i have i problem,
  • when program run function RFID Card Reader => function show image crash,
  • or when program run function show image => function RFID Card Reader crash (don't run) because while loop
I am try like this, but do not work :(
parpool(2)
parfevalOnAll(@maxNumCompThreads, 0, 2)
spmd
if labindex == 1
first_function
else
second_function
end
end
Is there any solution for me?? I think need run two Function (show image & listening Serial port Arduino) Simultaneously
Thanks a lot.

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!