Unable to control LED on Arduino Due. Pin 13 is not a valid Digital Input/Output pin.
16 views (last 30 days)
Show older comments
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
0 Comments
Answers (1)
Abhinav Aravindan
on 8 Nov 2024 at 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:
0 Comments
See Also
Categories
Find more on Modeling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!