2017-07-05 02:17:26 +02:00
|
|
|
// Auto-generated. Do not edit.
|
|
|
|
declare namespace input {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Left button.
|
|
|
|
*/
|
|
|
|
//% indexedInstanceNS=input indexedInstanceShim=pxt::getButton
|
|
|
|
//% block="button left" weight=95 fixedInstance shim=pxt::getButton(0)
|
|
|
|
const buttonLeft: Button;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Right button.
|
|
|
|
*/
|
|
|
|
//% block="button right" weight=94 fixedInstance shim=pxt::getButton(1)
|
|
|
|
const buttonRight: Button;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Up button.
|
|
|
|
*/
|
|
|
|
//% block="button up" weight=95 fixedInstance shim=pxt::getButton(2)
|
|
|
|
const buttonUp: Button;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Down button.
|
|
|
|
*/
|
|
|
|
//% block="button down" weight=95 fixedInstance shim=pxt::getButton(3)
|
|
|
|
const buttonDown: Button;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enter button.
|
|
|
|
*/
|
|
|
|
//% block="button enter" weight=95 fixedInstance shim=pxt::getButton(4)
|
|
|
|
const buttonEnter: Button;
|
|
|
|
}
|
2017-07-05 14:06:58 +02:00
|
|
|
declare namespace control {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine the version of system software currently running.
|
|
|
|
*/
|
|
|
|
//% shim=control::deviceFirmwareVersion
|
|
|
|
function deviceFirmwareVersion(): string;
|
|
|
|
}
|
2017-07-05 13:27:54 +02:00
|
|
|
declare namespace output {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set lights.
|
|
|
|
*/
|
|
|
|
//% blockId=setLights block="set lights %pattern" shim=output::setLights
|
|
|
|
function setLights(pattern: LightsPattern): void;
|
|
|
|
}
|
2017-07-05 02:17:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-05 13:27:54 +02:00
|
|
|
//% fixedInstances
|
2017-07-05 02:17:26 +02:00
|
|
|
declare interface Button {
|
|
|
|
/**
|
|
|
|
* Do something when a button (`A`, `B` or both `A` + `B`) is clicked, double clicked, etc...
|
|
|
|
* @param button the button that needs to be clicked or used
|
|
|
|
* @param event the kind of button gesture that needs to be detected
|
|
|
|
* @param body code to run when the event is raised
|
|
|
|
*/
|
|
|
|
//% help=input/button/on-event weight=99 blockGap=8
|
|
|
|
//% blockId=buttonEvent block="on %button|%event"
|
|
|
|
//% parts="buttonpair"
|
|
|
|
//% blockNamespace=input
|
|
|
|
//% button.fieldEditor="gridpicker"
|
|
|
|
//% button.fieldOptions.width=220
|
|
|
|
//% button.fieldOptions.columns=3 shim=ButtonMethods::onEvent
|
|
|
|
onEvent(ev: ButtonEvent, body: () => void): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if a button is pressed or not.
|
|
|
|
* @param button the button to query the request
|
|
|
|
*/
|
|
|
|
//% help=input/button/is-pressed weight=79
|
|
|
|
//% block="%button|is pressed"
|
|
|
|
//% blockId=buttonIsPressed
|
|
|
|
//% blockGap=8
|
|
|
|
//% parts="buttonpair"
|
|
|
|
//% blockNamespace=input
|
|
|
|
//% button.fieldEditor="gridpicker"
|
|
|
|
//% button.fieldOptions.width=220
|
|
|
|
//% button.fieldOptions.columns=3 shim=ButtonMethods::isPressed
|
|
|
|
isPressed(): boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* See if the button was pressed again since the last time you checked.
|
|
|
|
* @param button the button to query the request
|
|
|
|
*/
|
|
|
|
//% help=input/button/was-pressed weight=78
|
|
|
|
//% block="%button|was pressed"
|
|
|
|
//% blockId=buttonWasPressed
|
|
|
|
//% parts="buttonpair" blockGap=8
|
|
|
|
//% blockNamespace=input advanced=true
|
|
|
|
//% button.fieldEditor="gridpicker"
|
|
|
|
//% button.fieldOptions.width=220
|
|
|
|
//% button.fieldOptions.columns=3 shim=ButtonMethods::wasPressed
|
|
|
|
wasPressed(): boolean;
|
|
|
|
}
|
2017-07-05 14:06:58 +02:00
|
|
|
declare namespace screen {
|
|
|
|
|
|
|
|
/** Draw text. */
|
2017-07-05 14:56:13 +02:00
|
|
|
//% mode.defl=0 shim=screen::drawText
|
|
|
|
function drawText(x: int32, y: int32, text: string, mode?: Draw): void;
|
|
|
|
|
|
|
|
/** Clear screen and reset font to normal. */
|
|
|
|
//% shim=screen::clear
|
|
|
|
function clear(): void;
|
|
|
|
|
|
|
|
/** Scroll screen vertically. */
|
|
|
|
//% shim=screen::scroll
|
|
|
|
function scroll(v: int32): void;
|
|
|
|
|
|
|
|
/** Set font for drawText() */
|
|
|
|
//% shim=screen::setFont
|
|
|
|
function setFont(font: ScreenFont): void;
|
2017-07-05 14:06:58 +02:00
|
|
|
}
|
2017-07-05 02:17:26 +02:00
|
|
|
|
|
|
|
// Auto-generated. Do not edit. Really.
|