Skip to content

Commit e928277

Browse files
committed
Hello world works
1 parent 47084aa commit e928277

File tree

4 files changed

+320
-203
lines changed

4 files changed

+320
-203
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ internal/
4444
.settings
4545
.vscode/*
4646
!.vscode/tasks.json
47+
mbit/microbit.asm
48+
mbit/microbit.hex

mbit/hello.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
function foo()
1+
function main()
22
{
33
basic.showString("hello world", 150)
44
}
5-
6-
foo()

mbit/mbit.d.ts

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
11
declare module basic {
2-
export function showString(text:string, interval:number):void;
3-
}
2+
/* {help:functions/show-string}
3+
* {weight:87}
4+
* {hints:interval:150,100,200,-100}
5+
* {shim:micro_bit::scrollString}
6+
*/
7+
/**
8+
* Display text on the display, one character at a time, and shift by one column each ``interval`` milliseconds. If the string fits on the screen (i.e. is one letter), does not scroll.
9+
*/
10+
export function showString(text: string, interval: number): void;
11+
12+
/**
13+
* Turn off all LEDs
14+
* {help:functions/clear-screen}
15+
* {weight:79}
16+
* {shim:micro_bit::clearScreen}
17+
* {atomic}
18+
*/
19+
export function clearScreen(): void;
420

21+
/**
22+
* Pause for the specified time in milliseconds
23+
* {help:functions/pause}
24+
* {weight:88}
25+
* {hints:ms:100,200,500,1000,2000}
26+
* {shim:micro_bit::pause}
27+
*/
28+
export function pause(ms: number): void;
29+
30+
/**
31+
* Scroll a number on the screen and shift by one column every ``interval`` milliseconds. If the number fits on the screen (i.e. is a single digit), does not scroll.
32+
* {help:functions/show-number}
33+
* {namespace:basic}
34+
* {weight:89}
35+
* {hints:interval:150,100,200,-100}
36+
* {shim:micro_bit::scrollNumber}
37+
*/
38+
export function showNumber(value: number, interval: number): void;
39+
}

0 commit comments

Comments
 (0)