Skip to content

Ed.ReadMusicEnd() returns invalid value #4

@PSLLSP

Description

@PSLLSP

This is a simple demo that Ed.ReadMusicEnd() returns some invalid value.

#-------------Setup----------------

import Ed

Ed.EdisonVersion = Ed.V2

Ed.DistanceUnits = Ed.CM
Ed.Tempo = Ed.TEMPO_MEDIUM

#--------Your code below-----------

led = False
Ed.PlayBeep()
while True:
    while Ed.ReadMusicEnd() == Ed.MUSIC_NOT_FINISHED:
        pass
    led = not led
    if led:
        Ed.LeftLed(Ed.ON)
        Ed.RightLed(Ed.OFF)
    else:
        Ed.LeftLed(Ed.OFF)
        Ed.RightLed(Ed.ON)
    Ed.TimeWait(50, Ed.TIME_MILLISECONDS)

This program stays in endless loop after the first turn. It waits for status Ed.MUSIC_NOT_FINISHED but it never receives it.
It passes first loop because Ed.PlayBeep() sets the status. But what happens to music status after that? Why it is set to Ed.MUSIC_NOT_FINISHED ??

Is it bug in ReadMusicEnd() or in robot firmware?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions