Communication with PIC Microcontroller

조회 수: 3 (최근 30일)
Sabarinathan Vadivelu
Sabarinathan Vadivelu 2013년 8월 14일
I have designed a face recognition system. If the face is recognized, I'm sending a character 'a' via serial port to microcontroller. If the face is not authorized, I'm sending a character 'b' via serial port to microcontroller.
Also, When I switch on the controller, it sends a character 'c' to MATLAB, at that time only it acquires the face image.
I have designed the face recognition system, Now my problem is how can I read the data from Microcontroller?
The code keeps on running and when MATLAB reads a character from serial port, it acquires the image. How to do it?

채택된 답변

Walter Roberson
Walter Roberson 2013년 8월 14일
serial() to create a port object, fopen() to open it. Configure it with a bytes available count of 1. Configure it to not be in line mode, including configuring the terminator as empty. fread() from the port, requesting 1 character. You can either loop the fread(), "polling" for actions, or you can set the bytes available function to have a call-back when the data is available.
  댓글 수: 7
Sabarinathan Vadivelu
Sabarinathan Vadivelu 2013년 8월 14일
Yes sir, Till that only I had done it. Now I need to know how can I do that above mentioned question.
Walter Roberson
Walter Roberson 2013년 8월 14일
serial() to create the port object... and so on, as I wrote above.
If you want code examples, search MATLAB Answers for "serial"

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by