more serial infos

This commit is contained in:
Peli de Halleux 2016-04-26 10:29:05 -07:00
parent 67f2fdcfec
commit 10d44b97cc
3 changed files with 4 additions and 3 deletions

View File

@ -15,7 +15,7 @@ namespace serial {
/**
* Sends a piece of text through Serial connection.
*/
//%
//% blockId=serial_writestring block="serial write %text"
void writeString(StringData *text) {
uBit.serial.send(ManagedString(text));
}

View File

@ -8,7 +8,7 @@ namespace serial {
* @param value to send over serial
*/
//% 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 {
writeString(text);
writeString("\r\n");
@ -17,6 +17,7 @@ namespace serial {
/**
* Prints a numeric value to the serial
*/
//% blockId=serial_writenumber block="serial|write number %value"
export function writeNumber(value: number): void {
writeString(value.toString());
}

View File

@ -528,7 +528,7 @@ declare namespace serial {
/**
* 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;
}