forked from microsoft/pxt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.ts
More file actions
37 lines (32 loc) · 881 Bytes
/
basic.ts
File metadata and controls
37 lines (32 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
namespace control {
//% shim=serial::writeString
export function __log(s: string) {
}
export function dmesg(s: string) {
// ignore
}
}
namespace console {
export function log(s: string) {
control.__log(s + "\n")
}
}
//% async
//% shim=basic::pause
function pause(ms: number): void {}
namespace control {
/**
* Pause for the specified time in milliseconds
* @param ms how long to pause for, eg: 100, 200, 500, 1000, 2000
*/
//% async block="pause (ms) %pause"
//% blockId=device_pause icon="\uf110" shim=basic::pause
export function pause(ms: number): void {
}
/**
* Schedules code that run in the background.
*/
//% blockId="control_in_background" block="run in background" blockGap=8 shim=control::inBackground
export function runInBackground(a: () => void): void
{ }
}