Aktualisiere main.ts, _locales/de/Grove-strings.json
This commit is contained in:
parent
96039f5012
commit
8aa1d9a487
@ -33,7 +33,7 @@
|
|||||||
"GroveJoystickKey.LL|block": "Unten links",
|
"GroveJoystickKey.LL|block": "Unten links",
|
||||||
"GroveJoystickKey.LR|block": "Unten rechts",
|
"GroveJoystickKey.LR|block": "Unten rechts",
|
||||||
"GroveJoystickKey.Press|block": "Gedrückt",
|
"GroveJoystickKey.Press|block": "Gedrückt",
|
||||||
"grove.ThumbJoystick.read|block": "%ThumbJoystick|lies Position von Joystick an|%xpin|und|%ypin",
|
"grove.joyread|block": "%ThumbJoystick|lies Position von Joystick an|%xpin|und|%ypin",
|
||||||
"grove.onJoystick|block": "wenn Grove - Joysticktaste|%key an|%xpin|und|%ypin",
|
"grove.onJoystick|block": "wenn Grove - Joysticktaste|%key an|%xpin|und|%ypin",
|
||||||
"grove.getJoystick|block": "hole Joysticktaste an|%xpin|und|%ypin"
|
"grove.getJoystick|block": "hole Joysticktaste an|%xpin|und|%ypin"
|
||||||
}
|
}
|
6
main.ts
6
main.ts
@ -412,7 +412,7 @@ namespace grove {
|
|||||||
*/
|
*/
|
||||||
//% blockId=grove_joystick_read block="%ThumbJoystick|read position of joystick at|%xpin|and|%ypin"
|
//% blockId=grove_joystick_read block="%ThumbJoystick|read position of joystick at|%xpin|and|%ypin"
|
||||||
//% advanced=true
|
//% advanced=true
|
||||||
read(xPin: AnalogPin, yPin: AnalogPin): number {
|
joyread(xPin: AnalogPin, yPin: AnalogPin): number {
|
||||||
let xdata = 0, ydata = 0, result = 0;
|
let xdata = 0, ydata = 0, result = 0;
|
||||||
if (xPin && yPin) {
|
if (xPin && yPin) {
|
||||||
xdata = pins.analogReadPin(xPin);
|
xdata = pins.analogReadPin(xPin);
|
||||||
@ -558,7 +558,7 @@ namespace grove {
|
|||||||
*/
|
*/
|
||||||
//% blockId=grove_getjoystick block="get joystick key at|%xpin|and|%ypin"
|
//% blockId=grove_getjoystick block="get joystick key at|%xpin|and|%ypin"
|
||||||
export function getJoystick(xpin: AnalogPin, ypin: AnalogPin): number {
|
export function getJoystick(xpin: AnalogPin, ypin: AnalogPin): number {
|
||||||
return joystick.read(xpin, ypin);
|
return joystick.joyread(xpin, ypin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -596,7 +596,7 @@ namespace grove {
|
|||||||
control.onEvent(joystickEventID, key, handler);
|
control.onEvent(joystickEventID, key, handler);
|
||||||
control.inBackground(() => {
|
control.inBackground(() => {
|
||||||
while(true) {
|
while(true) {
|
||||||
const key = joystick.read(xpin, ypin);
|
const key = joystick.joyread(xpin, ypin);
|
||||||
if (key != lastJoystick) {
|
if (key != lastJoystick) {
|
||||||
lastJoystick = key;
|
lastJoystick = key;
|
||||||
control.raiseEvent(joystickEventID, lastJoystick);
|
control.raiseEvent(joystickEventID, lastJoystick);
|
||||||
|
Loading…
Reference in New Issue
Block a user