More typos

This commit is contained in:
qucchia 2022-07-27 16:23:58 +02:00
parent c5bb94bf7a
commit 0ff89a939a
13 changed files with 53 additions and 54 deletions

View File

@ -615,7 +615,7 @@ void jswrap_ble_restart(JsVar *callback) {
}
Get this device's default Bluetooth MAC address.
For Puck.js, the last 5 characters of this (eg. `ee:ff`) are used in the
For Puck.js, the last 5 characters of this (e.g. `ee:ff`) are used in the
device's advertised Bluetooth name.
*/
JsVar *jswrap_ble_getAddress() {
@ -826,7 +826,7 @@ NRF.setAdvertising({},{
```
If you're using [EspruinoHub](https://github.com/espruino/EspruinoHub) then it
will automatically decode this into the folling MQTT topics:
will automatically decode this into the following MQTT topics:
* `/ble/advertise/ma:c_:_a:dd:re:ss/espruino` -> `{"a":10,"b":15}`
* `/ble/advertise/ma:c_:_a:dd:re:ss/a` -> `1`
@ -1738,7 +1738,7 @@ bool jswrap_ble_filter_device(JsVar *filters, JsVar *device) {
}
Start/stop listening for BLE advertising packets within range. Returns a
`BluetoothDevice` for each advertsing packet. **By default this is not an active
`BluetoothDevice` for each advertising packet. **By default this is not an active
scan, so Scan Response advertising data is not included (see below)**
```
@ -2775,7 +2775,7 @@ void jswrap_ble_ancsAction(int uid, bool isPositive) {
"return" : ["JsVar", "A `Promise` that is resolved (or rejected) when the connection is complete" ],
"return_object" : "Promise"
}
Get ANCS info for a notification, eg:
Get ANCS info for a notification, e.g.:
@ -3028,9 +3028,9 @@ here, Espruino will pick the FIRST device it finds, or it'll call `catch`.
* `filters` - a list of filters that a device must match before it is returned
(see below)
* `timeout` - the maximum time to scan for in milliseconds (scanning stops when
a match is found. eg. `NRF.requestDevice({ timeout:2000, filters: [ ... ] })`
a match is found. e.g. `NRF.requestDevice({ timeout:2000, filters: [ ... ] })`
* `active` - whether to perform active scanning (requesting 'scan response'
packets from any devices that are found). eg. `NRF.requestDevice({ active:true,
packets from any devices that are found). e.g. `NRF.requestDevice({ active:true,
filters: [ ... ] })`
* `phy` - (NRF52840 only) use the long-range coded phy (`"1mbps"` default, can
be `"1mbps/2mbps/both/coded"`)
@ -3269,7 +3269,7 @@ void jswrap_ble_setWhitelist(bool whitelist) {
]
}
When connected, Bluetooth LE devices communicate at a set interval. Lowering the
interval (eg. more packets/second) means a lower delay when sending data, higher
interval (e.g. more packets/second) means a lower delay when sending data, higher
bandwidth, but also more power consumption.
By default, when connected as a peripheral Espruino automatically adjusts the
@ -3358,7 +3358,7 @@ NRF.setSecurity({passkey:"123456", mitm:1, display:1});
```
However, while most devices will request a passkey for pairing at this point it
is still possible for a device to connect without requiring one (eg. using the
is still possible for a device to connect without requiring one (e.g. using the
'NRF Connect' app).

View File

@ -230,11 +230,11 @@ Show an image on the in-built 5x5 LED screen.
Image can be:
* A number where each bit represents a pixel (so 25 bits). eg. `5` or
* A number where each bit represents a pixel (so 25 bits). e.g. `5` or
`0x1FFFFFF`
* A string, eg: `show("10001")`. Newlines are ignored, and anything that is not
* A string, e.g: `show("10001")`. Newlines are ignored, and anything that is not
a space or `0` is treated as a 1.
* An array of 4 bytes (more will be ignored), eg `show([1,2,3,0])`
* An array of 4 bytes (more will be ignored), e.g `show([1,2,3,0])`
For instance the following works for images:

View File

@ -235,7 +235,7 @@ passed as parameters. Put differently, if the passed SSID and password are
identical to the currently connected AP then nothing is changed. When the
connection attempt completes the callback function is invoked with one `err`
parameter, which is NULL if there is no error and a string message if there is
an error. If DHCP is enabled the callback occurs once an IP addres has been
an error. If DHCP is enabled the callback occurs once an IP address has been
obtained, if a static IP is set the callback occurs once the AP's network has
been joined. The callback is also invoked if a connection already exists and
does not need to be changed.
@ -568,7 +568,7 @@ connecting to an access point.
["callback", "JsVar", "An optional `callback()` function to be called back when the hostname is set"]
]
}
Set the hostname. Depending on implemenation, the hostname is sent with every
Set the hostname. Depending on implementation, the hostname is sent with every
DHCP request and is broadcast via mDNS. The DHCP hostname may be visible in the
access point and may be forwarded into DNS as hostname.local. If a DHCP lease
currently exists changing the hostname will cause a disconnect and reconnect in
@ -667,6 +667,6 @@ Switch to using a higher communication speed with the WiFi module.
* `true` = 921600 baud
* `false` = 115200
* `1843200` (or any number) = use a specific baud rate. * eg.
* `1843200` (or any number) = use a specific baud rate. * e.g.
`wifi.turbo(true,callback)` or `wifi.turbo(1843200,callback)`
*/

View File

@ -334,10 +334,9 @@ bool jswrap_ethernet_setIP(JsVar *wlanObj, JsVar *options, JsVar *callback) {
],
"return" : ["bool","True on success"]
}
Set hostname allow to set the hosname used during the dhcp request. min 8 and
max 12 char, best set before calling `eth.setIP()` Default is WIZnet010203,
010203 is the default nic as part of the mac. Best to set the hosname before
calling setIP().
Set hostname used during the DHCP request. Minimum 8 and maximum 12 characters,
best set before calling `eth.setIP()`. Default is WIZnet010203, 010203 is the
default nic as part of the mac.
*/
bool jswrap_ethernet_setHostname(JsVar *wlanObj, JsVar *jsHostname, JsVar *callback){
NOT_USED(wlanObj);

View File

@ -477,7 +477,7 @@ int jswrap_date_getMonth(JsVar *parent) {
"generate" : "jswrap_date_getFullYear",
"return" : ["int32",""]
}
The year, eg. 2014
The year, e.g. 2014
*/
int jswrap_date_getFullYear(JsVar *parent) {
return getCalendarDateFromDateVar(parent, false/*system timezone*/).year;
@ -675,7 +675,7 @@ JsVarFloat jswrap_date_setFullYear(JsVar *parent, int yearValue, JsVar *monthVal
"return" : ["JsVar","A String"],
"typescript" : "toString(): string;"
}
Converts to a String, eg: `Fri Jun 20 2014 14:52:20 GMT+0000`
Converts to a String, e.g: `Fri Jun 20 2014 14:52:20 GMT+0000`
**Note:** This uses whatever timezone was set with `E.setTimeZone()` or
`E.setDST()`
@ -706,7 +706,7 @@ JsVar *jswrap_date_toString(JsVar *parent) {
"return" : ["JsVar","A String"],
"typescript" : "toUTCString(): string;"
}
Converts to a String, eg: `Fri, 20 Jun 2014 14:52:20 GMT`
Converts to a String, e.g: `Fri, 20 Jun 2014 14:52:20 GMT`
**Note:** This always assumes a timezone of GMT
*/
@ -725,7 +725,7 @@ JsVar *jswrap_date_toUTCString(JsVar *parent) {
"return" : ["JsVar","A String"],
"typescript" : "toISOString(): string;"
}
Converts to a ISO 8601 String, eg: `2014-06-20T14:52:20.123Z`
Converts to a ISO 8601 String, e.g: `2014-06-20T14:52:20.123Z`
**Note:** This always assumes a timezone of GMT
*/
@ -754,7 +754,7 @@ JsVar *jswrap_date_toISOString(JsVar *parent) {
"return" : ["JsVar","A String"],
"typescript" : "toLocalISOString(): string;"
}
Converts to a ISO 8601 String (with timezone information), eg:
Converts to a ISO 8601 String (with timezone information), e.g:
`2014-06-20T14:52:20.123-0500`
*/
JsVar *jswrap_date_toLocalISOString(JsVar *parent) {

View File

@ -217,7 +217,7 @@ JsVarFloat jswrap_parseFloat(JsVar *v) {
],
"return" : ["bool","True is the value is a Finite number, false if not."]
}
Is the parameter a finite num,ber or not? If needed, the parameter is first
Is the parameter a finite number or not? If needed, the parameter is first
converted to a number.
*/
bool jswrap_isFinite(JsVar *v) {

View File

@ -158,7 +158,7 @@ void jswrap_io_poke(JsVarInt addr, JsVar *data, int wordSize) {
],
"return" : ["float","The analog Value of the Pin between 0 and 1"]
}
Get the analog value of the given pin
Get the analogue value of the given pin
This is different to Arduino which only returns an integer between 0 and 1023
@ -181,7 +181,7 @@ Set the analog Value of a pin. It will be output using PWM.
Objects can contain:
* `freq` - pulse frequency in Hz, eg. ```analogWrite(A0,0.5,{ freq : 10 });``` -
* `freq` - pulse frequency in Hz, e.g. ```analogWrite(A0,0.5,{ freq : 10 });``` -
specifying a frequency will force PWM output, even if the pin has a DAC
* `soft` - boolean, If true software PWM is used if hardware is not available.
* `forceSoft` - boolean, If true software PWM is used even if hardware PWM or a
@ -219,7 +219,7 @@ hardware timer to produce accurate pulses, and returns immediately (before the
pulse has finished). Use `digitalPulse(A0,1,0)` to wait until a previous pulse
has finished.
eg. `digitalPulse(A0,1,5);` pulses A0 high for 5ms.
e.g. `digitalPulse(A0,1,5);` pulses A0 high for 5ms.
`digitalPulse(A0,1,[5,2,4]);` pulses A0 high for 5ms, low for 2ms, and high for
4ms
@ -285,7 +285,7 @@ Set the digital value of the given pin.
**Note:** if you didn't call `pinMode` beforehand then this function will also
reset pin's state to `"output"`
If pin argument is an array of pins (eg. `[A2,A1,A0]`) the value argument will
If pin argument is an array of pins (e.g. `[A2,A1,A0]`) the value argument will
be treated as an array of bits where the last array element is the least
significant bit.
@ -343,7 +343,7 @@ Get the digital value of the given pin.
**Note:** if you didn't call `pinMode` beforehand then this function will also
reset pin's state to `"input"`
If the pin argument is an array of pins (eg. `[A2,A1,A0]`) the value returned
If the pin argument is an array of pins (e.g. `[A2,A1,A0]`) the value returned
will be an number where the last array element is the least significant bit, for
example if `A0=A1=1` and `A2=0`, `digitalRead([A2,A1,A0]) == 0b011`
@ -705,7 +705,7 @@ will happen on both edges and there will be no debouncing.
pin's state to `"input"`
**Note:** The STM32 chip (used in the [Espruino Board](/EspruinoBoard) and
[Pico](/Pico)) cannot watch two pins with the same number - eg `A0` and `B0`.
[Pico](/Pico)) cannot watch two pins with the same number - e.g. `A0` and `B0`.
**Note:** On nRF52 chips (used in Puck.js, Pixl.js, MDBT42Q) `setWatch` disables
the GPIO output on that pin. In order to be able to write to the pin again you

View File

@ -37,7 +37,7 @@ This class contains information about Espruino itself
"name" : "uncaughtException",
"params" : [["exception","JsVar","The uncaught exception"]]
}
This event is called when an exception gets thrown and isn't caught (eg. it gets
This event is called when an exception gets thrown and isn't caught (e.g. it gets
all the way back to the event loop).
You can use this for logging potential problems that might occur during
@ -106,7 +106,7 @@ Returns an Object containing various pre-defined variables.
* `VERSION` - is the Espruino version
* `GIT_COMMIT` - is Git commit hash this firmware was built from
* `BOARD` - the board's ID (eg. `PUCKJS`)
* `BOARD` - the board's ID (e.g. `PUCKJS`)
* `RAM` - total amount of on-chip RAM in bytes
* `FLASH` - total amount of on-chip flash memory in bytes
* `SPIFLASH` - (on Bangle.js) total amount of off-chip flash memory in bytes

View File

@ -72,7 +72,7 @@ errors:true });`
**Note:** Even though there was an error, the byte will still be received and
passed to the `data` handler.
**Note:** This only works on STM32 and NRF52 based devices (eg. all official
**Note:** This only works on STM32 and NRF52 based devices (e.g. all official
Espruino boards)
*/
/*JSON{
@ -89,7 +89,7 @@ errors:true });`
**Note:** Even though there was an error, the byte will still be received and
passed to the `data` handler.
**Note:** This only works on STM32 and NRF52 based devices (eg. all official
**Note:** This only works on STM32 and NRF52 based devices (e.g. all official
Espruino boards)
*/
// this is created in jsiIdle based on EV_SERIALx_STATUS ecents
@ -104,7 +104,7 @@ Espruino boards)
],
"return" : ["JsVar","An object of type `Serial`, or `undefined` if one couldn't be found."]
}
Try and find a USART (Serial) hardware device that will work on this pin (eg.
Try and find a USART (Serial) hardware device that will work on this pin (e.g.
`Serial1`)
May return undefined if no device can be found.
@ -233,7 +233,7 @@ void jswrap_serial_setConsole(JsVar *parent, bool force) {
}
Setup this Serial port with the given baud rate and options.
eg.
e.g.
```
Serial1.setup(9600,{rx:a_pin, tx:a_pin});
@ -426,7 +426,7 @@ void _jswrap_serial_print(JsVar *parent, JsVar *arg, bool isPrint, bool newLine)
}
Print a string to the serial port - without a line feed
**Note:** This function replaces any occurances of `\n` in the string with
**Note:** This function replaces any occurrences of `\n` in the string with
`\r\n`. To avoid this, use `Serial.write`.
*/
/*JSON{
@ -440,7 +440,7 @@ Print a string to the serial port - without a line feed
}
Print a line to the serial port with a newline (`\r\n`) at the end of it.
**Note:** This function converts data to a string first, eg
**Note:** This function converts data to a string first, e.g.
`Serial.print([1,2,3])` is equivalent to `Serial.print("1,2,3"). If you'd like
to write raw bytes, use `Serial.write`.
*/
@ -461,7 +461,7 @@ void jswrap_serial_println(JsVar *parent, JsVar *str) {
}
Write a character or array of data to the serial port
This method writes unmodified data, eg `Serial.write([1,2,3])` is equivalent to
This method writes unmodified data, e.g. `Serial.write([1,2,3])` is equivalent to
`Serial.write("\1\2\3")`. If you'd like data converted to a string first, use
`Serial.print`.
*/

View File

@ -79,7 +79,7 @@ JsVar *jswrap_spi_constructor() {
],
"return" : ["JsVar","An object of type `SPI`, or `undefined` if one couldn't be found."]
}
Try and find an SPI hardware device that will work on this pin (eg. `SPI1`)
Try and find an SPI hardware device that will work on this pin (e.g. `SPI1`)
May return undefined if no device can be found.
*/
@ -541,7 +541,7 @@ JsVar *jswrap_i2c_constructor() {
],
"return" : ["JsVar","An object of type `I2C`, or `undefined` if one couldn't be found."]
}
Try and find an I2C hardware device that will work on this pin (eg. `I2C1`)
Try and find an I2C hardware device that will work on this pin (e.g. `I2C1`)
May return undefined if no device can be found.
*/

View File

@ -58,7 +58,7 @@ simple contiguous files of fixed length. This is the recommended file type.
in numbered chunks (`"filename\1"`/`"filename\2"`/etc). It allows data to be
appended and for the file to be read line by line.
You must read a file using the same method you used to write it - eg. you can't
You must read a file using the same method you used to write it - e.g. you can't
create a file with `require("Storage").open(...)` and then read it with
`require("Storage").read(...)`.
@ -317,11 +317,11 @@ require("Storage").list()
require("Storage").list(/\.js$/)
// All Storage Files
require("Storage").list(undefined, {sf:true})
// All normal files (eg created with Storage.write)
// All normal files (e.g. created with Storage.write)
require("Storage").list(undefined, {sf:false})
```
**Note:** This will output system files (eg. saved code) as well as files that
**Note:** This will output system files (e.g. saved code) as well as files that
you may have written.
*/
JsVar *jswrap_storage_list(JsVar *regex, JsVar *filter) {
@ -351,10 +351,10 @@ JsVar *jswrap_storage_list(JsVar *regex, JsVar *filter) {
"return" : ["int","A hash of the files matching"],
"typescript" : "hash(regex: RegExp): number;"
}
List all files in the flash storage area matching the specfied regex (ignores
List all files in the flash storage area matching the specified regex (ignores
StorageFiles), and then hash their filenames *and* file locations.
Identical files may have different hashes (eg. if Storage is compacted and the
Identical files may have different hashes (e.g. if Storage is compacted and the
file moves) but the changes of different files having the same hash are
extremely small.
@ -389,7 +389,7 @@ when it is running low on flash, or when `compact` is called.
space, however in this case it will not lose data.
**Note:** `compact` rearranges the contents of memory. If code is referencing
that memory (eg. functions that have their code stored in flash) then they may
that memory (e.g. functions that have their code stored in flash) then they may
become garbled when compaction happens. To avoid this, call `eraseFiles` before
uploading data that you intend to reference to ensure that uploaded files are
right at the start of flash and cannot be compacted further.
@ -597,7 +597,7 @@ contiguous area to allow them to be accessed easily from Espruino.
This presents a challenge for `StorageFile` which allows you to append to a
file, so instead `StorageFile` stores files in chunks. It uses the last
character of the filename to denote the chunk number (eg `"foobar\1"`,
character of the filename to denote the chunk number (e.g. `"foobar\1"`,
`"foobar\2"`, etc).
This means that while `StorageFile` files exist in the same area as those from

View File

@ -231,7 +231,7 @@ Returns `null` if no match, or:
]
```
'Global' RegEx matches just return an array of matches (with no indices):
'Global' RegExp matches just return an array of matches (with no indices):
```
"abcdefabcdef".match(/bcd/g) = [
@ -305,7 +305,7 @@ JsVar *jswrap_string_match(JsVar *parent, JsVar *subStr) {
],
"return" : ["JsVar","This string with `subStr` replaced"]
}
Search and replace ONE occurrance of `subStr` with `newSubStr` and return the
Search and replace ONE occurrence of `subStr` with `newSubStr` and return the
result. This doesn't alter the original string. Regular expressions not
supported.
*/
@ -480,10 +480,10 @@ JsVar *jswrap_string_slice(JsVar *parent, JsVarInt pStart, JsVar *vEnd) {
],
"return" : ["JsVar","Part of this string from start for len characters"]
}
Return an array made by splitting this string up by the separator. eg.
Return an array made by splitting this string up by the separator. e.g.
```'1,2,3'.split(',')==['1', '2', '3']```
Regular Expressions can also be used to split strings, eg. `'1a2b3
Regular Expressions can also be used to split strings, e.g. `'1a2b3
4'.split(/[^0-9]/)==['1', '2', '3', '4']`.
*/
JsVar *jswrap_string_split(JsVar *parent, JsVar *split) {
@ -757,7 +757,7 @@ JsVar *jswrap_string_repeat(JsVar *parent, int count) {
"return" : ["JsVar","A string containing this string padded to the correct length"],
"return_object" : "String"
}
Pad this string at the beginnind to the required number of characters
Pad this string at the beginning to the required number of characters
```
"Hello".padStart(10) == " Hello"

View File

@ -20,7 +20,7 @@
"type" : "class",
"class" : "NodeMCU"
}
This is a built-in class to allow you to use the ESP8266 NodeMCU boards's pin
This is a built-in class to allow you to use the ESP8266 NodeMCU boards' pin
namings to access pins. It is only available on ESP8266-based boards.
*/