Seeed Studio Grove Modul für Calliope MakeCode -> Anpassung der ThingSpeak-Cloud auf rlp.schule
Go to file
Christian Meyer 445e3e2103 Serveradresse auf iot.rlp.schule setzen. 2023-07-18 11:10:46 +02:00
_locales Add GroveAHT20 2021-03-03 09:31:50 +09:00
blocks Add GroveAHT20 2021-03-03 09:31:50 +09:00
sensors Add GroveAHT20 2021-03-03 09:31:50 +09:00
.gitattributes 🎉 Added .gitattributes & .gitignore files 2017-06-23 09:54:17 +08:00
.gitignore add Grove - Thumb Joystick 2018-09-14 14:11:57 +08:00
LICENSE Create LICENSE 2021-06-24 14:26:48 +08:00
Makefile Update 2017-06-23 09:54:44 +08:00
README.md bump to 0.3.0; support Grove UART WiFi V2 2020-10-12 20:55:42 +08:00
icon.png Update icon 2018-01-29 17:29:21 +08:00
main.ts Serveradresse auf iot.rlp.schule setzen. 2023-07-18 11:10:46 +02:00
pxt.json update to v0.5.0 2021-03-03 08:41:54 +08:00
test.ts bump to 0.3.0; support Grove UART WiFi V2 2020-10-12 20:55:42 +08:00
tsconfig.json Update 2017-06-23 09:54:44 +08:00

README.md

Grove

A Microsoft MakeCode package for for Seeed Studio Grove module.

Basic usage

Grove - Gesture

get gesture model.



grove.onGesture(GroveGesture.Up, () => {
    basic.showString("Up");
})
grove.onGesture(GroveGesture.Down, () => {
    basic.showString("Down");
})


grove.initGesture()
basic.forever(function () {
    if (grove.getGestureModel() == 1) {
        basic.showLeds(`
            . . # . .
            . . . # .
            # # # # #
            . . . # .
            . . # . .
            `)
    }
    if (grove.getGestureModel() == 2) {
        basic.showLeds(`
            . . # . .
            . # . . .
            # # # # #
            . # . . .
            . . # . .
            `)
    }
    if (grove.getGestureModel() == 3) {
        basic.showLeds(`
            . . # . .
            . # # # .
            # . # . #
            . . # . .
            . . # . .
            `)
    }
    if (grove.getGestureModel() == 4) {
        basic.showLeds(`
            . . # . .
            . . # . .
            # . # . #
            . # # # .
            . . # . .
            `)
    }
    basic.pause(100)
})

all the model


/**
 * Grove Gestures
 */
enum GroveGesture {
    //% block=None
    None = 0,
    //% block=Right
    Right = 1,
    //% block=Left
    Left = 2,
    //% block=Up
    Up = 3,
    //% block=Down
    Down = 4,
    //% block=Forward
    Forward = 5,
    //% block=Backward
    Backward = 6,
    //% block=Clockwise
    Clockwise = 7,
    //% block=Anticlockwise
    Anticlockwise = 8,
    //% block=Wave
    Wave = 9
}

Grove - Ultrasonic Ranger

Measure distance in centimeters, specify the signal pin.

let distance = grove.measureInCentimeters(DigitalPin.P0);

Measure distance in inches, specify the signal pin.

let distance = grove.measureInInches(DigitalPin.P0);

Grove - 4 digital display

Create a 4 Digital Display driver, specify the clk and data pin, and set the brightness level, then start display value.

let display = grove.createDisplay(DigitalPin.P0, DigitalPin.P1);
display.set(7);
display.show(1234);

Use ||bit|| to display one bit number.

Use ||point|| to open or close point dispay.

Use ||clear|| to clean display.

Grove - UART WiFi V2

Connect to a WiFi and send data to ThinkSpeak or IFTTT, specify the UART tx and rx pin.

grove.setupWifi(
    SerialPin.P15,
    SerialPin.P1,
    BaudRate.BaudRate115200,
    "test-ssid",
    "test-passwd"
)

basic.forever(() => {
    if (grove.wifiOK()) {
        basic.showIcon(IconNames.Yes)
    } else {
        basic.showIcon(IconNames.No)
    }
    grove.sendToThinkSpeak("write_api_key", 1, 2, 3, 4, 5, 6, 7, 8)
    grove.sendToIFTTT("ifttt_event", "ifttt_key", "hello", 'micro', 'bit')
    basic.pause(60000)
})

License

MIT

Supported targets

  • for PXT/calliopemini