Hello guys, please help me to solve the below mentioned error regarding clearing arduino object
5 次查看(过去 30 天)
显示 更早的评论
回答(2 个)
EngEdgarHS
2017-5-19
编辑:EngEdgarHS
2017-5-19
Hi, you cannot use x this way. If you are using pin 13 as digital output, try:
x = 1;
writeDigitalPin(a, 'D13', x);
but if you want to read state of this pin as digital input (I think you want to do this by the format of your code), try:
[y,fs]=audioread('Blank Space.mp3');
configurePin(a,'D13', 'digitalInput');
x = readDigitalPin(a,'D13');
if x==1
sound(y,fs)
else
clear sound;
end
For clear Arduino object, try it:
clear board;
if ~isempty(instrfind)
fclose(instrfind);
delete (instrfind);
end
clear a;
Good luck.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Device Driver Blocks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!