more serial infos
This commit is contained in:
parent
67f2fdcfec
commit
10d44b97cc
@ -15,7 +15,7 @@ namespace serial {
|
|||||||
/**
|
/**
|
||||||
* Sends a piece of text through Serial connection.
|
* Sends a piece of text through Serial connection.
|
||||||
*/
|
*/
|
||||||
//%
|
//% blockId=serial_writestring block="serial write %text"
|
||||||
void writeString(StringData *text) {
|
void writeString(StringData *text) {
|
||||||
uBit.serial.send(ManagedString(text));
|
uBit.serial.send(ManagedString(text));
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ namespace serial {
|
|||||||
* @param value to send over serial
|
* @param value to send over serial
|
||||||
*/
|
*/
|
||||||
//% help=serial/write-line
|
//% help=serial/write-line
|
||||||
//% blockId=serial_writeline block="serial|write %text"
|
//% blockId=serial_writeline block="serial|write line %text"
|
||||||
export function writeLine(text: string): void {
|
export function writeLine(text: string): void {
|
||||||
writeString(text);
|
writeString(text);
|
||||||
writeString("\r\n");
|
writeString("\r\n");
|
||||||
@ -17,6 +17,7 @@ namespace serial {
|
|||||||
/**
|
/**
|
||||||
* Prints a numeric value to the serial
|
* Prints a numeric value to the serial
|
||||||
*/
|
*/
|
||||||
|
//% blockId=serial_writenumber block="serial|write number %value"
|
||||||
export function writeNumber(value: number): void {
|
export function writeNumber(value: number): void {
|
||||||
writeString(value.toString());
|
writeString(value.toString());
|
||||||
}
|
}
|
||||||
|
2
libs/microbit/shims.d.ts
vendored
2
libs/microbit/shims.d.ts
vendored
@ -528,7 +528,7 @@ declare namespace serial {
|
|||||||
/**
|
/**
|
||||||
* Sends a piece of text through Serial connection.
|
* Sends a piece of text through Serial connection.
|
||||||
*/
|
*/
|
||||||
//% shim=serial::writeString
|
//% blockId=serial_writestring block="serial write %text" shim=serial::writeString
|
||||||
function writeString(text: string): void;
|
function writeString(text: string): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user