Cherry picked fixes from v0 to v1 (#1476)
* Fix example and do a few edits (#850) * Small fixes to the Karel project text (#862) * fix missing shadow type * add calibration info (#897) microbit-support:6348 User reported bug, but didn't realie micro:bit compass had to be calibrated on first run of the program. * Cherry pick adding various cross-editor compat APIs (#863) * fix nudge * Fix a typo ("screent") in the documentation (#1012) * Fix a typo "screent" -> "the LED screen" * Update showArrow doc string for consistency with other methods * Doc bugs found by xlators (#899) * Update rotation.md (#998) reflects actual behaviour of the board * fixed layout corruption (#1073) * Updating the new bug filer with the right link * Update challenges.md (#1325) For what I'm taught in school, 2 follows 1 😉😉. * Update simulator.md (#1209) * Update plant watering.md (#1264) the connection to servo are male not female * support for MIDI simulator in v0 (#1331) * Doc improvements (#1337) * update grammar in radio-dashboard sample code * Chanllenge 2 follows 1 I open all challenges.md without "Challenge 2" and review the file `grep -r "Challenge 2" -L | grep challenge | xargs -I@ code @` Changes to be committed: modified: docs/lessons/counter/challenges.md modified: docs/lessons/game-counter/challenges.md modified: docs/lessons/night-light/challenges.md modified: docs/lessons/snowflake-fall/challenges.md * Revert "support for MIDI simulator in v0 (#1331)" This reverts commit 30a9c411fb80762656e7a636feff8e77b7fd9e67. * Revert "Cherry pick adding various cross-editor compat APIs (#863)" This reverts commit 7308dbef23e9ee402bebb7e721d7014d8252c9e5. * Fixed pin needed to replace button A (#1385) * Cherry pick part of the signature update in in2cWriteBuffer (#863): 7308dbe
This commit is contained in:
@ -191,7 +191,7 @@
|
||||
"basic.showAnimation": "Shows a sequence of LED screens as an animation.",
|
||||
"basic.showAnimation|param|interval": "time in milliseconds between each redraw",
|
||||
"basic.showAnimation|param|leds": "pattern of LEDs to turn on/off",
|
||||
"basic.showArrow": "Shows an arrow on screent",
|
||||
"basic.showArrow": "Draws an arrow on the LED screen",
|
||||
"basic.showArrow|param|direction": "the direction of the arrow",
|
||||
"basic.showArrow|param|interval": "the amount of time (milliseconds) to show the icon. Default is 600.",
|
||||
"basic.showIcon": "Draws the selected icon on the LED screen",
|
||||
@ -513,4 +513,4 @@
|
||||
"serial.writeValue": "Write a name:value pair as a line to the serial port.",
|
||||
"serial.writeValue|param|name": "name of the value stream, eg: x",
|
||||
"serial.writeValue|param|value": "to write"
|
||||
}
|
||||
}
|
||||
|
@ -326,8 +326,8 @@
|
||||
"pins.analogWritePin|block": "analog write|pin %name|to %value",
|
||||
"pins.digitalReadPin|block": "digital read|pin %name",
|
||||
"pins.digitalWritePin|block": "digital write|pin %name|to %value",
|
||||
"pins.i2cReadNumber|block": "i2c read number|at address %address|of format %format=i2c_sizeof|repeated %repeat",
|
||||
"pins.i2cWriteNumber|block": "i2c write number|at address %address|with value %value|of format %format=i2c_sizeof|repeated %repeat",
|
||||
"pins.i2cReadNumber|block": "i2c read number|at address %address|of format %format|repeated %repeat",
|
||||
"pins.i2cWriteNumber|block": "i2c write number|at address %address|with value %value|of format %format|repeated %repeat",
|
||||
"pins.map|block": "map %value|from low %fromLow|from high %fromHigh|to low %toLow|to high %toHigh",
|
||||
"pins.onPulsed|block": "on|pin %pin|pulsed %pulse",
|
||||
"pins.pulseDuration|block": "pulse duration (µs)",
|
||||
|
@ -189,7 +189,7 @@ namespace basic {
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows an arrow on screent
|
||||
* Draws an arrow on the LED screen
|
||||
* @param direction the direction of the arrow
|
||||
* @param interval the amount of time (milliseconds) to show the icon. Default is 600.
|
||||
*/
|
||||
|
@ -381,9 +381,9 @@ namespace pins {
|
||||
* Write bytes to a 7-bit I2C `address`.
|
||||
*/
|
||||
//%
|
||||
void i2cWriteBuffer(int address, Buffer buf, bool repeat = false)
|
||||
int void i2cWriteBuffer(int address, Buffer buf, bool repeat = false)
|
||||
{
|
||||
uBit.i2c.write(address << 1, (char*)buf->data, buf->length, repeat);
|
||||
return uBit.i2c.write(address << 1, (char*)buf->data, buf->length, repeat);
|
||||
}
|
||||
|
||||
SPI* spi = NULL;
|
||||
|
@ -22,7 +22,7 @@ namespace pins {
|
||||
* Read one number from 7-bit I2C address.
|
||||
*/
|
||||
//% help=pins/i2c-read-number blockGap=8 advanced=true
|
||||
//% blockId=pins_i2c_readnumber block="i2c read number|at address %address|of format %format=i2c_sizeof|repeated %repeat" weight=7
|
||||
//% blockId=pins_i2c_readnumber block="i2c read number|at address %address|of format %format|repeated %repeat" weight=7
|
||||
export function i2cReadNumber(address: number, format: NumberFormat, repeated?: boolean): number {
|
||||
let buf = pins.i2cReadBuffer(address, pins.sizeOf(format), repeated)
|
||||
return buf.getNumber(format, 0)
|
||||
@ -32,7 +32,7 @@ namespace pins {
|
||||
* Write one number to a 7-bit I2C address.
|
||||
*/
|
||||
//% help=pins/i2c-write-number blockGap=8 advanced=true
|
||||
//% blockId=i2c_writenumber block="i2c write number|at address %address|with value %value|of format %format=i2c_sizeof|repeated %repeat" weight=6
|
||||
//% blockId=i2c_writenumber block="i2c write number|at address %address|with value %value|of format %format|repeated %repeat" weight=6
|
||||
export function i2cWriteNumber(address: number, value: number, format: NumberFormat, repeated?: boolean): void {
|
||||
let buf = createBuffer(pins.sizeOf(format))
|
||||
buf.setNumber(format, 0, value)
|
||||
|
2
libs/core/shims.d.ts
vendored
2
libs/core/shims.d.ts
vendored
@ -728,7 +728,7 @@ declare namespace pins {
|
||||
* Write bytes to a 7-bit I2C `address`.
|
||||
*/
|
||||
//% repeat.defl=0 shim=pins::i2cWriteBuffer
|
||||
function i2cWriteBuffer(address: int32, buf: Buffer, repeat?: boolean): void;
|
||||
function i2cWriteBuffer(address: int32, buf: Buffer, repeat?: boolean): int32;
|
||||
|
||||
/**
|
||||
* Write to the SPI slave and return the response
|
||||
|
Reference in New Issue
Block a user