Arduino mega 2560 Pin 9 issue

1 vue (au cours des 30 derniers jours)
David Hughes
David Hughes le 30 Déc 2020
Hello,
I'm using the Simulink support package for Arduino Hardware and going through this example https://uk.mathworks.com/help/supportpkg/arduino/ref/communicating-with-arduino-hardware.html
communicating with arduino hardware.
I'm using Windows 10, 2020b, connecting by USB.
At "Task 3 - Simulate the Model
To simulate the model, follow these steps:
1. Observe that the model plays the motion energy recorded in a room and compares it with a threshold to detect intrusion.
2. In the model, change the Simulation mode on the toolbar to Normal. This tells Simulink to run the model on the host computer. See Task 4 below to run the model on the Arduino target hardware.
3. In the model, click the Run button in the Simulink toolbar."
For the suimulation mode is it this dropdown which includes 'Accelerator' and 'Fast Accelerator' in which case where is the 'External' mentioned in the following task?
If it is this then when used I am getting this error;
"MATLAB System block 'arduino_communication/Digital Output' error occurred when invoking 'setupImpl' method of 'codertarget.arduinobase.blocks.DigitalWrite'. The error was thrown from ' 'C:\ProgramData\MATLAB\SupportPackages\R2020b\toolbox\target\shared\devicedrivers\+matlabshared\+devicedrivers\+blocks\DigitalIO.p' at line 0'.
Caused by:
  • Configuring Pin 9 as Digital Input/Output failed. Pin 9 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. "
Am I using the wrong Normal or is there an issue with Pin 9 on the Mega? The example states it is configured for the Mega already.
Thanks in advance.
  5 commentaires
Ali mohsen
Ali mohsen le 7 Mai 2023
same issue MATLAB2023a
Walter Roberson
Walter Roberson le 7 Mai 2023
This is a bit odd, as pin 9 does appear to be a digital pin -- at least if it is being referred to as 'D9'

Connectez-vous pour commenter.

Réponses (1)

Salah
Salah le 23 Sep 2022
I am facing the same exact error but on Ubuntu with latest version of Matlab. I wish there is a solution
  1 commentaire
Muhammad Qureshi
Muhammad Qureshi le 7 Mar 2023
Any luck? I have the very same problem

Connectez-vous pour commenter.

Catégories

En savoir plus sur Arduino Hardware dans Help Center et File Exchange

Tags

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by