How to add 'Tone' on digital pin of Arduino Uno?

조회 수: 3 (최근 30일)
renaud schuck
renaud schuck 2022년 1월 26일
댓글: renaud schuck 2022년 1월 28일
Hi,
I am having an issue with the function PlayTone and my Arduino Uno.
I am using Matlab 2018b.
I am trying to configure a Digital Pin on my arduino uno with the specificity "Tone".
However whenever I try it, I get the following answer:
configurePin(a,'D7','Tone')
Invalid digital pin mode. The mode must be a character vector or string. Valid mode
values are:
DigitalInput, DigitalOutput, Pullup, PWM, Servo, SPI, Interrupt, Unset
Whenever I try to use the function Playtone (on D7) I get:
playTone(a,'D7',4000,5)
Invalid pin number. Valid PWM pin numbers for board Uno are D3, D5, D6, D9, D10, D11.
However, all the valid PWM pin numbers are taken by the servo that I am using.
Please let me know if you have a solution, I am pulling my hair out here..
Thanks,
Renaud

답변 (1개)

Walter Roberson
Walter Roberson 2022년 1월 26일
Tone was not supported until R2019a... the version immediately after the one you are using.

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by