-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.ts
More file actions
31 lines (27 loc) · 1.27 KB
/
test.ts
File metadata and controls
31 lines (27 loc) · 1.27 KB
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
makerbit.net.connectESP(DigitalPin.P0, DigitalPin.P1);
makerbit.net.connectWiFi("network", "secret");
makerbit.net.connectProjectGroup("123-456-789", "1");
makerbit.net.waitForConnection(NetworkConnection.PROJECT_GROUP);
const isConnected: boolean = makerbit.net.isConnected(
NetworkConnection.PROJECT_GROUP
);
const level: number = makerbit.net.getConnection();
const error: number = makerbit.net.getLastError();
const device: string = makerbit.net.getDevice();
makerbit.net.sendNumber(1);
makerbit.net.sendString("hello world");
makerbit.net.sendScreenshot();
makerbit.net.sendNumberToChannel(23, "compass");
makerbit.net.sendStringToChannel("Ernie", "name");
makerbit.net.onReceivedNumber((value: number) => { });
makerbit.net.onReceivedString((value: string) => { });
makerbit.net.onReceivedScreenshot((screenshot: Image) => { });
makerbit.net.onReceivedNumberInChannel("compass", (value: number) => { });
makerbit.net.onReceivedStringInChannel("name", (value: string) => { });
makerbit.net.onConnection(() => { });
makerbit.net.onError(() => { });
makerbit.net.setTimeZone(makerbit.timezone(TimeZone.UTC));
makerbit.net.setTimeZoneWithUtcOffset(-8, 0);
const time: string = makerbit.net.getTime();
const date: string = makerbit.net.getDate();
const weekday: number = makerbit.net.getWeekday();