Problem using 'getkey'.
이전 댓글 표시
For some reason 'getkey' is not working in Matlab R2014a. It keeps saying 'undefined function/variable' whenever I use getkey. Can anyone tell me what to do?
clear all;
clc;
fprintf('\nPress any key: ') ;
% prompt='Enter any key';
%ch=input(prompt);
k=getkey;
answer=1;
arduino=serial('COM15','BaudRate',9600); % create serial communication object on port COM15
fopen(arduino); % initiate arduino communication
while(answer)
fprintf(arduino,'%s',char(k)); % send answer variable content to arduino
answer=input('Enter value(0=EXIT PROGRAM): ');
end
fclose(arduino); % end communication with arduino
채택된 답변
추가 답변 (1개)
MathWorks MATLAB Hardware Team
2024년 4월 2일
0 개 추천
Hello,
Thank you for contacting us.
To enhance your experience interfacing Arduino with MATLAB, we suggest utilizing the MATLAB Support Package for Arduino hardware. You can find more information here: https://in.mathworks.com/matlabcentral/fileexchange/47522-matlab-support-package-for-arduino-hardware
Best regards,
MATLAB Hardware Team
MathWorks
카테고리
도움말 센터 및 File Exchange에서 Get Started with MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!