Control LED using Bluetooth in Matlab without using serial port

조회 수: 1 (최근 30일)
Seet Ting Ma
Seet Ting Ma 2016년 4월 23일
댓글: Walter Roberson 2016년 4월 23일
Good day everyone.
recently I wish to wireless control a LED using Bluetooth with Arduin in Matlab.
I have successfully create the connection.
Yet, I dont know how to write the script to control the LED wirelessly.
Below is the code that I use to create connection:
bt = Bluetooth('HC-05',1);
fopen(bt);
fclose(bt);
clear(bt)
How to write the code in between fopen and fclose to controll the LED??
use fprintf / fwrite / or ??
i really dont know how to do so...
Please help me if you know it...
I really need so idea...

답변 (1개)

Walter Roberson
Walter Roberson 2016년 4월 23일
Yes, you can use fprintf(), fwrite(), fread(), fgets(), fgetl()
  댓글 수: 2
Seet Ting Ma
Seet Ting Ma 2016년 4월 23일
can you please give me a line of example?
Walter Roberson
Walter Roberson 2016년 4월 23일
turndeg = -17;
fprintf(bt, 'Turn %d degrees right\n', turndeg);

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

카테고리

Help CenterFile Exchange에서 Test and Measurement에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by