Unable to control LED on Arduino Due. Pin 13 is not a valid Digital Input/Output pin.

16 次查看(过去 30 天)
I'm trying the following tutorial : https://youtu.be/ksUSdFlAkAI
I'm using Arduino Due board.
I'm getting the bellow mentioned error. I'm trying to build the simulation with manual switch.
I've attached my simulink model file.
I tried running the system with Admin previledge as suggested in the link but with no success. I also tried chnaging the baud rate as suggested by some articles but again no success.
Error :
MATLAB System block 'arduinodemo/Digital Output' error occurred when invoking 'setupImpl' method of 'codertarget.arduinobase.blocks.DigitalWrite'. The error was thrown from ' 'C:\ProgramData\MATLAB\SupportPackages\R2022a\toolbox\target\shared\devicedrivers\+matlabshared\+devicedrivers\+blocks\DigitalIO.p' at line 0 'C:\Program Files\MATLAB\R2022a\toolbox\target\codertarget\sltoolstrip\m\+codertarget\+internal\+sltoolstrip\ConnectedIOHandler.m' at line 106 'C:\Program Files\MATLAB\R2022a\toolbox\target\codertarget\sltoolstrip\m\+codertarget\+sltoolstrip\EmbeddedHardwareBoardContext.m' at line 440'.
Caused by: Configuring Pin 13 as Digital Input/Output failed. Pin 13 is not a valid Digital Input/Output pin. Reconnect the hardware, provide a valid Digital Input/Output pin number for your hardware and try again.
Component:Simulink | Category:Block error

回答(1 个)

Abhinav Aravindan
Abhinav Aravindan 2024-11-8,7:51
Hi Ishaan,
I was facing a similar issue with Connected IO using Arduino, but it appears to be working in the latest update of MATLAB R2022a. I would suggest you install the latest update of R2022a (Update 8) to resolve the issue.
Further, in the model provided it appears that you have set the Set host COM Port” parameter to “Manually Specify” in “Host-board connection” tab of the Configuration Parameters. I would recommend setting it to the default as “Automatically” for Simulink to automatically detect the Arduino board connected to your host computer and establish a serial communication using the available COM port.
Please refer to the below documentation on Simulation with Connected IO using Arduino for further detail:

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

标签

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by