[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: playTone duration in Arduino package

From: Cathy Zupke
Subject: Re: playTone duration in Arduino package
Date: Wed, 10 Mar 2021 14:58:48 -0800

Here is an annotated interactive session that I hope answers John's questions (Octave version is 5.2.0, on Windows 10, arduino version looks like 0.6.0):

>> pkg load arduino
>> a=arduino()
a =
  arduino object with fields of:
    port = \\.\COM4
    board = uno
    libraries = {
    availablepins = {
      d0 - d13
      a0 - a5
>> playTone(a,'D10',440,1) %piezo speaker is attached to D10 and makes a tone that never stops
>> playTone(a,'D10',300,1) %frequency changes but never stops
>> playTone(a,'D10',0,1) %sound stops
>> playTone(a,'D10',180,3) %makes a tone that never stops
>> playTone(a,'D10',440,0) %frequency changes but never stops
>> version   %I think this gives the version of octave
ans = 5.2.0

>> pkg list  %It looks like arduino package version is 0.6.0
Package Name         | Version | Installation directory
            arduino *|   0.6.0 | ...\OCTAVE~1.0\mingw64\share\octave\packages\arduino-0.6.0
              audio  |   2.0.0 | C:\Octave\OCTAVE~1.0\mingw64\share\octave\packages\audio-2.0.0
     communications  |   1.2.2 | ...\mingw64\share\octave\packages\communications-1.2.2

It is my understanding that the last parameter is supposed to be duration in seconds. So I'd expect the tones to stop after that time has elapsed.



On Wed, Mar 10, 2021 at 7:06 AM JohnD <> wrote:

> Message: 2
> Date: Mon, 1 Mar 2021 22:04:22 -0600 (CST)
> From: Ekpuz <>
> To:
> Subject: playTone duration in Arduino package
> Message-ID: <" target="_blank">>
> Content-Type: text/plain; charset=us-ascii
> I'm trying to use the Arduino package to control an Arduino Uno compatible
> board.  When I use playTone, it will play a tone of the specified frequency,
> but the duration parameter seems to do nothing.  I'm wondering if this is a
> bug or if there is something I may not be doing correctly.
> -Cathy

What version of octave, what version of the Arduino package, and can you give a simple example of what you are doing ?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]