Arduino mega 2560 Pin 9 issue

1 回表示 (過去 30 日間)
David Hughes
David Hughes 2020 年 12 月 30 日
コメント済み: Walter Roberson 2023 年 5 月 7 日
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 件のコメント
Ali mohsen
Ali mohsen 2023 年 5 月 7 日
same issue MATLAB2023a
Walter Roberson
Walter Roberson 2023 年 5 月 7 日
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'

サインインしてコメントする。

回答 (1 件)

Salah
Salah 2022 年 9 月 23 日
I am facing the same exact error but on Ubuntu with latest version of Matlab. I wish there is a solution
  1 件のコメント
Muhammad Qureshi
Muhammad Qureshi 2023 年 3 月 7 日
Any luck? I have the very same problem

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeArduino Hardware についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by