Exposing pin eventOn method (#349)

This commit is contained in:
Richard Knoll
2017-01-30 11:19:54 -08:00
committed by Peli de Halleux
parent 436b56a2fa
commit 72d5e83e5b
8 changed files with 123 additions and 29 deletions

10
libs/core/shims.d.ts vendored
View File

@ -628,6 +628,16 @@ declare namespace pins {
//% blockId=device_set_pull block="set pull|pin %pin|to %pull" shim=pins::setPull
function setPull(name: DigitalPin, pull: PinPullMode): void;
/**
* Configures the events emitted by this pin. Events can be subscribed to
* using ``control.onEvent()``.
* @param name pin to set the event mode on, eg: DigitalPin.P0
* @param type the type of events for this pin to emit, eg: PinEventType.Edge
*/
//% help=pins/set-events weight=4 advanced=true
//% blockId=device_set_pin_events block="set pin %pin|to emit %type|events" shim=pins::setEvents
function setEvents(name: DigitalPin, type: PinEventType): void;
/**
* Create a new zero-initialized buffer.
* @param size number of bytes in the buffer