"play" bug?

vttom

Senior Member
Is there a bug with the PE's simulator regarding the "play" command, or is the documentation in error?

The documentation says "play <pin>, <tune>" but when I simulate this command, the simulator seems to have the arguments reversed ("play <tune>, <pin>").

FYI - The Help->About page for the PE says it's Version 5.4.0.
 

hippy

Ex-Staff (retired)
This worked for me in simulation, cycling through the tunes ...

Code:
#Picaxe 08M2
Do
  For b0 = 0 To 3
    Play 4, b0
  Next
Loop
Which PICAXE are you simulating for ?
 

vttom

Senior Member
My test code used "#picaxe 08m". I just tried your version and it works correctly for me, so the difference is with the "#picaxe" directive.

Code:
#picaxe 08m

' I would expect the following to play the
' 4 built-in tunes in order when run in the
' simulator. Instead, I get "Jingle Bells"
' (tune #1) every time.
play 1, 0
play 1, 1
play 1, 2
play 1, 3

' If I swap the order of the arguments, it
' appears to work
play 0, 1
play 1, 1
play 2, 1
play 3, 1
 
Last edited:

hippy

Ex-Staff (retired)
The difference is with the PLAY commands for different types of PICAXE ...

PLAY pin, tune (all non-8 pin parts)
PLAY pin, tune, LED_mask (M2 parts only)
PLAY tune, LED_option (8 pin devices only)
 
Top