Skip to content

microbit.scale() returns a float from integer inputs #121

Closed
@microbit-carlos

Description

@microbit-carlos

For example, with code like this we get an error as scale() is returning a float:

from microbit import *

my_effect = audio.SoundEffect()

while True:
    my_effect.freq_start = scale(accelerometer.get_x(), from_=(-2000, 2000), to=(0, 9999))
    my_effect.freq_end = scale(accelerometer.get_y(), from_=(-2000, 2000), to=(0, 9999))
    audio.play(my_effect)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions