MATLAB abd Arduino UNO serial comm.(LED blinking)

버전 1.0.0.0 (159 Bytes) 작성자: MATuino R
LED connected to pin 13 of arduino uno will be controlled using serial communication from MATLAB .
다운로드 수: 1.5K
업데이트 날짜: 2014/7/31

라이선스 보기

A serial communication is established between arduino uno and MATLAB and the LED on pin 13 of arduino uno can be toggled using number '100' and '101'. Before executing this .m-file ,make sure the following code below is uploaded on arduino UNO:
Note: Make sure the COM port number is correctly entered in MATLAB program

const int ledpin=13;
int recValue;

void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
}

void loop()
{
if(Serial.available()>0)
{
recValue=Serial.read();

if (recValue == 100) // If use will send value 100 from MATLAB then LED will turn ON
{
digitalWrite(ledpin, HIGH);
}
if(recValue == 101) // If use will send value 101 from MATLAB then LED will turn OFF
{
digitalWrite(ledpin, LOW);
}
}
}

인용 양식

MATuino R (2025). MATLAB abd Arduino UNO serial comm.(LED blinking) (https://kr.mathworks.com/matlabcentral/fileexchange/47418-matlab-abd-arduino-uno-serial-comm-led-blinking), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2013a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Motion Detection에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0