why do i keep getting the arduino Uno detected message saying it is ready for support package i have the package installed but it keeps stopping my code

5 Ansichten (letzte 30 Tage)
Connect_Arduino('a') ;
%define servo placement and mins and maxes
servo1 = servo(a, 'D3', 'MinPulseDuration', 700*10^-6, 'MaxPulseDuration', 2300*10^-6);
servo2 = servo(a, 'D5', 'MinPulseDuration', 700*10^-6, 'MaxPulseDuration', 2300*10^-6);
servo3 = servo(a, 'D6', 'MinPulseDuration', 700*10^-6, 'MaxPulseDuration', 2300*10^-6);
%home servos
writePosition(servo1, 0);
writePosition(servo2, 0);
writePosition(servo3, 0);
stay = true;
position = input ('where do you want me to go position 1, 2 ,or 3? ');
if position == 1
while( stay == true)
%move servos to position 1 settings
servo1.write(60);
servo2.write(20);
servo3.write(60)
%wait 5 seconds
wait(5);
%chance to move positions.
stay = input ('stay? true,false');
end
elseif position == 2
while( stay == true)
%move servos to position 2 settings
servo1.write(60);
servo2.write(20);
servo3.write(60);
% wait 5 seconds
wait(5);
%chance to move positions.
input ('stay? true,false');
end
end
this is my code, whenever i run it i get this messege
This device is ready for use with MATLAB Support Package for Arduino Hardware. Get started with examples and other documentation.
This device is ready for use with Simulink Support Package for Arduino Hardware. Get started with example
i already have the packeges downloaded and installed but it will not let me run my code

Antworten (1)

Madhu Govindarajan
Madhu Govindarajan am 5 Dez. 2018
I guess what Walter is saying is that you are not using the MATLAB Support package for Arduino when you use Connect_Arduino command. Instead use a = arduino to use the MATLAB Support package for Arduino to connect to Arduino.
The rest of the functions might also need to be modified to take advantage of MATLAB Support.
Madhu

Kategorien

Mehr zu MATLAB Support Package for Arduino Hardware finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by