Merge branch 'master' into master

This commit is contained in:
Michael Klein 2020-09-17 21:42:16 +02:00 committed by GitHub
commit 8d81b2a132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -126,4 +126,4 @@ MIT
## Supported targets
* for PXT/microbit
* for PXT/calliopemini

View File

@ -416,6 +416,7 @@ namespace grove {
*/
joyread(xPin: AnalogPin, yPin: AnalogPin): number {
let xdata = 0, ydata = 0, result = 0;
if (xPin && yPin) {
xdata = pins.analogReadPin(xPin);
@ -463,6 +464,7 @@ namespace grove {
//% pin.fieldEditor="gridpicker" pin.fieldOptions.columns=4
//% pin.fieldOptions.tooltips="false" pin.fieldOptions.width="250"
//% group="Ultrasonic" pin.defl=DigitalPin.C16
export function measureInCentimeters(pin: DigitalPin): number
{
let duration = 0;
@ -613,6 +615,7 @@ namespace grove {
*/
//% blockId=grove_joystick_create_event block="on Key|%key at |%xpin|and|%ypin"
//% group="Thumbjoystick" xpin.defl=AnalogPin.C16 ypin.defl=AnalogPin.C17
export function onJoystick(key: GroveJoystickKey, xpin: AnalogPin, ypin: AnalogPin, handler: () => void) {
control.onEvent(joystickEventID, key, handler);
control.inBackground(() => {