Changing the pin of Arduino in Matlab script for mapping algorithm

3 次查看(过去 30 天)
HI guys,
I want to know that either we can change the predefined digital pin of Arduino in Matlab mapping algorithm or not. I am attaching the refrence link where i took the code. Now i am not sure that either these digital pins are predefined in libraries or just in a script. Thanks for your help
  1 个评论
Floris
Floris 2019-6-11
Hello,
Are you talking about the digital pins defined in the example code?
%% Create an ultrasonic sensor object with trigger pin D12 and echo pin D13.
% Create a servo object for the servo connected to pin D3.
sensor = addon(a, 'JRodrigoTech/HCSR04', 'D12', 'D13');
servo_motor = servo(a, 'D3');
Because you should be able to just configure 'D12', 'D13', 'D3' to other pins on your board.
You can read more about setting arduino pins here:

请先登录,再进行评论。

采纳的回答

Ali Khan
Ali Khan 2019-6-11
Thanks for your reply,
Actually i was confused that it can be possible or not. My main purpose is to send the data from arduino uning bluetooth to Matlab and map it.

更多回答(1 个)

Ali Khan
Ali Khan 2019-6-11
Right now , I am implementing the example code available at the following link. When i run the code, a following error pop up. Can you tell me what is the exactly problem?
Undefined function or variable 'table'.
Error in Mapping_Your_Surroundings_Using_ArduinoandUltrasonicSensor (line 47)
polarplot (table(:,1)*pi/180, table (:,2));
  1 个评论
Floris
Floris 2019-6-12
Hello Ali,
I would open this as a separate question rather than using this question-answer thread to answer more questions. This error is, as the error states, because you have not defined 'table'. This means that the MATLAB compiler has no idea what to do with the word 'table' so take a good look at your code to see what table should be.
-Floris

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 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!

Translated by