Approved content

The content below is provided by a partner.

aorczyk/pf-recorder 0.0.2 GitHub

Power Functions Recorder

Recording commands from LEGO Power Functions remote controls and playing them. Using IR Receiver Module Iduino ST1089 and IR 940 nm emitting diode.

LEGO Power Functions RC documentation: https://www.philohome.com/pf/LEGO_Power_Functions_RC.pdf

Features:

Functions

Sometimes program registers more commands because some commands are missed by LEGO PF receiver.

:warning: Warning!

Lighting the diode and the IR receiver with sunlight :sunny: or from an ordinary light bulb :bulb: may interfere with the signal reception.

Documentation

pfRecorder.init

Initialize recorder.

pfRecorder.init(
    DigitalPin.P2,
    AnalogPin.P0,
    PfReceiverChannel.Channel2,
    false
)

Parameters

pfRecorder.reverseOrder

Returns commands list in reversed order.

let commandsInReversedOrder = pfRecorder.reverseOrder(recordedCommands);

Parameters

pfRecorder.reverseCommands

Processes and returns command list reversing only commands from given channel and output.

let reversedCommands = pfRecorder.reverseCommands(recordedCommands, 0, 0);

Parameters

pfRecorder.play

Plays commands recorded by PF Receiver extension.

pfRecorder.play(commands)

Parameters

pfRecorder.stopPlaying

Stops playing commands and stops all used outputs channels.

pfRecorder.stopPlaying()

MakeCode Example

pfRecorder.init(
    DigitalPin.P2,
    AnalogPin.P0,
    PfReceiverChannel.Channel2,
    false
)

Disclaimer

LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this project.

License

Copyright (C) 2021 Adam Orczyk

Licensed under the MIT License (MIT). See LICENSE file for more details.

Supported targets