{"id":22344976,"url":"https://github.com/seeed-studio/pxt-grove","last_synced_at":"2025-04-06T22:08:27.437Z","repository":{"id":22077346,"uuid":"95173019","full_name":"Seeed-Studio/pxt-grove","owner":"Seeed-Studio","description":"A Microsoft MakeCode package for Seeed Studio Grove module","archived":false,"fork":false,"pushed_at":"2025-01-07T08:58:38.000Z","size":330,"stargazers_count":36,"open_issues_count":0,"forks_count":48,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-30T20:12:43.136Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://makecode.microbit.org/pkg/seeed-studio/pxt-grove","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Seeed-Studio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-23T01:55:02.000Z","updated_at":"2025-01-07T08:58:41.000Z","dependencies_parsed_at":"2025-01-01T11:07:30.190Z","dependency_job_id":"1c7045d0-1ad6-49e2-8e03-4e3c5be317fd","html_url":"https://github.com/Seeed-Studio/pxt-grove","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seeed-Studio%2Fpxt-grove","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seeed-Studio%2Fpxt-grove/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seeed-Studio%2Fpxt-grove/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seeed-Studio%2Fpxt-grove/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Seeed-Studio","download_url":"https://codeload.github.com/Seeed-Studio/pxt-grove/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T09:15:45.789Z","updated_at":"2025-04-06T22:08:27.421Z","avatar_url":"https://github.com/Seeed-Studio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grove\n\nA Microsoft MakeCode package for for Seeed Studio Grove module.\n\n## Basic usage\n\n### Grove - Gesture\n\nget gesture model.\n\n```blocks\n\n\ngrove.onGesture(GroveGesture.Up, () =\u003e {\n    basic.showString(\"Up\");\n})\ngrove.onGesture(GroveGesture.Down, () =\u003e {\n    basic.showString(\"Down\");\n})\n\n\ngrove.initGesture()\nbasic.forever(function () {\n    if (grove.getGestureModel() == 1) {\n        basic.showLeds(`\n            . . # . .\n            . . . # .\n            # # # # #\n            . . . # .\n            . . # . .\n            `)\n    }\n    if (grove.getGestureModel() == 2) {\n        basic.showLeds(`\n            . . # . .\n            . # . . .\n            # # # # #\n            . # . . .\n            . . # . .\n            `)\n    }\n    if (grove.getGestureModel() == 3) {\n        basic.showLeds(`\n            . . # . .\n            . # # # .\n            # . # . #\n            . . # . .\n            . . # . .\n            `)\n    }\n    if (grove.getGestureModel() == 4) {\n        basic.showLeds(`\n            . . # . .\n            . . # . .\n            # . # . #\n            . # # # .\n            . . # . .\n            `)\n    }\n    basic.pause(100)\n})\n```\nall the model\n```\n\n/**\n * Grove Gestures\n */\nenum GroveGesture {\n    //% block=None\n    None = 0,\n    //% block=Right\n    Right = 1,\n    //% block=Left\n    Left = 2,\n    //% block=Up\n    Up = 3,\n    //% block=Down\n    Down = 4,\n    //% block=Forward\n    Forward = 5,\n    //% block=Backward\n    Backward = 6,\n    //% block=Clockwise\n    Clockwise = 7,\n    //% block=Anticlockwise\n    Anticlockwise = 8,\n    //% block=Wave\n    Wave = 9\n}\n```\n\n### Grove - Ultrasonic Ranger\n\nMeasure distance in centimeters, specify the signal pin.\n\n```blocks\nlet distance = grove.measureInCentimeters(DigitalPin.P0);\n```\n\nMeasure distance in inches, specify the signal pin.\n\n```blocks\nlet distance = grove.measureInInches(DigitalPin.P0);\n```\n\n### Grove - 4 digital display\n\nCreate a 4 Digital Display driver, specify the clk and data pin, and set the brightness level, then start display value.\n\n```blocks\nlet display = grove.createDisplay(DigitalPin.P0, DigitalPin.P1);\ndisplay.set(7);\ndisplay.show(1234);\n```\n\nUse ``||bit||`` to display one bit number.\n\nUse ``||point||`` to open or close point dispay.\n\nUse ``||clear||`` to clean display.\n\n### Grove - UART WiFi V2\n\nConnect to a WiFi and send data to ThinkSpeak or IFTTT, specify the UART tx and rx pin.\n\n```blocks\ngrove.setupWifi(\n    SerialPin.P15,\n    SerialPin.P1,\n    BaudRate.BaudRate115200,\n    \"test-ssid\",\n    \"test-passwd\"\n)\n\nbasic.forever(() =\u003e {\n    if (grove.wifiOK()) {\n        basic.showIcon(IconNames.Yes)\n    } else {\n        basic.showIcon(IconNames.No)\n    }\n    grove.sendToThinkSpeak(\"write_api_key\", 1, 2, 3, 4, 5, 6, 7, 8)\n    grove.sendToIFTTT(\"ifttt_event\", \"ifttt_key\", \"hello\", 'micro', 'bit')\n    basic.pause(60000)\n})\n```\n\n### Grove - LCD 16x2\n\nShow string and number after initialize LCD.\n\n```blocks\ngrove.lcd_init()\ngrove.lcd_show_string(\"Hello\", 0, 0)\ngrove.lcd_show_number(12345, 0, 1)\n```\n\n## License\n\nMIT\n\n## Supported targets\n\n* for PXT/calliopemini\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseeed-studio%2Fpxt-grove","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseeed-studio%2Fpxt-grove","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseeed-studio%2Fpxt-grove/lists"}