Skip to content

Commit

Permalink
Added first version of extension
Browse files Browse the repository at this point in the history
  • Loading branch information
alex m. santo committed Oct 24, 2024
0 parents commit 8d05132
Show file tree
Hide file tree
Showing 18 changed files with 2,041 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/cfg-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Check pxt.json

on:
push:
branches:
- 'master'
- 'main'

jobs:
check-cfg:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: |
npm install -g pxt
pxt target microbit
- name: Checkout current state
run: |
git checkout -- .
git clean -fd
- name: Fix files listed in config if necessary
run: pxt checkpkgcfg
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
continue-on-error: true
with:
title: 'Removing missing files from pxt.json'
commit-message: 'Removing missing files from pxt.json'
delete-branch: true
29 changes: 29 additions & 0 deletions .github/workflows/makecode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: MakeCode

on: [push]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: |
npm install -g pxt
pxt target microbit
- name: build
run: |
pxt install
pxt build --cloud
env:
CI: true
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# MakeCode
built
node_modules
yotta_modules
yotta_targets
pxt_modules
_site
*.db
*.tgz
.header.json
.simstate.json
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"editor.formatOnType": true,
"files.autoSave": "afterDelay",
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/built/**": true,
"**/node_modules/**": true,
"**/yotta_modules/**": true,
"**/yotta_targets": true,
"**/pxt_modules/**": true
},
"files.associations": {
"*.blocks": "html",
"*.jres": "json"
},
"search.exclude": {
"**/built": true,
"**/node_modules": true,
"**/yotta_modules": true,
"**/yotta_targets": true,
"**/pxt_modules": true
}
}
30 changes: 30 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

// A task runner that calls the MakeCode (PXT) compiler
{
"version": "2.0.0",
"tasks": [{
"label": "pxt deploy",
"type": "shell",
"command": "pxt deploy --local",
"group": "build",
"problemMatcher": [ "$tsc" ]
}, {
"label": "pxt build",
"type": "shell",
"command": "pxt build --local",
"group": "build",
"problemMatcher": [ "$tsc" ]
}, {
"label": "pxt install",
"type": "shell",
"command": "pxt install",
"group": "build",
"problemMatcher": [ "$tsc" ]
}, {
"label": "pxt clean",
"type": "shell",
"command": "pxt clean",
"group": "test",
"problemMatcher": [ "$tsc" ]
}]
}
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Ahead.IO Limited

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
all: deploy

build:
pxt build

deploy:
pxt deploy

test:
pxt test
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# micro:bit STELLA Robot Kit

![](/stella.png/)

This extension is designed to programme and drive the micro:bit STELLA Robot Kit. You can [get micro:bit STELLA Robot Kit from Ahead.](https://www.ahead.io)

## Code Example
```JavaScript
input.onButtonPressed(Button.A, function () {
stella.execution_action(stella.action_enum.Sit_down)
})
input.onButtonPressed(Button.AB, function () {
stella.move_xgo(stella.direction_enum.Forward, 50)
})
input.onButtonPressed(Button.B, function () {
stella.execution_action(stella.action_enum.Wave)
})
stella.init_xgo_serial(SerialPin.P1, SerialPin.P2)
stella.execution_action(stella.action_enum.Default_posture)
stella.leg_lift_continue(30, 3)
basic.forever(function () {

})
```

## Supported targets
for PXT/microbit

## License
MIT
8 changes: 8 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
makecode:
target: microbit
platform: microbit
home_url: https://makecode.microbit.org/
theme: jekyll-theme-slate
include:
- assets
- README.md
3 changes: 3 additions & 0 deletions _locales/STELLA-jsdoc-strings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"stella": "Functions to micro:bit STELLA robot dog by ELECFREAKS Co.,Ltd."
}
86 changes: 86 additions & 0 deletions _locales/STELLA-strings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"stella.action_enum.Crawl_forward|block": "Crawl_forward",
"stella.action_enum.Default_posture|block": "Default_posture",
"stella.action_enum.Go_prone|block": "Go_prone",
"stella.action_enum.Handshake|block": "Handshake",
"stella.action_enum.Looking_for_food|block": "Looking_for_food",
"stella.action_enum.Pee|block": "Pee",
"stella.action_enum.Play_pendulum|block": "Play_pendulum",
"stella.action_enum.Request_feeding|block": "Request_feeding",
"stella.action_enum.Sit_down|block": "Sit_down",
"stella.action_enum.Squat|block": "Squat",
"stella.action_enum.Stand|block": "Stand",
"stella.action_enum.Stretch_oneself|block": "Stretch_oneself",
"stella.action_enum.Sur_place|block": "Sur_place",
"stella.action_enum.Triaxial_rotation|block": "Triaxial_rotation",
"stella.action_enum.Twirl_Pitch|block": "Twirl_Pitch",
"stella.action_enum.Twirl_Roll|block": "Twirl_Roll",
"stella.action_enum.Twirl_Yaw|block": "Twirl_Yaw",
"stella.action_enum.Wave|block": "Wave",
"stella.action_enum.Whirl|block": "Whirl",
"stella.speed_frequency_enum.servo_speed|block": "servo speed",
"stella.speed_frequency_enum.stepped_frequency|block": "stepped frequency",
"stella.speed_enum.fast|block": "fast",
"stella.speed_enum.normal|block": "normal",
"stella.speed_enum.slow|block": "slow",
"stella.translation_direction_enum.Forward|block": "forward(0mm~25mm)",
"stella.translation_direction_enum.Backward|block": "backward(-25mm~0mm)",
"stella.translation_direction_enum.left_shift|block": "left-shift(0mm~18mm)",
"stella.translation_direction_enum.right_shift|block": "right-shift(-18mm~0mm)",
"stella.rotate_direction_enum.turn_left|block": "left-turn",
"stella.rotate_direction_enum.turn_right|block": "right-turn",
"stella.switch_enum.Turn_on|block": "Turn on",
"stella.switch_enum.Turn_off|block": "Turn off",
"stella.servo_switch_enum.Load|block": "load",
"stella.servo_switch_enum.Unload|block": "unload",
"stella.body_parts_enum.left_front|block": "left front",
"stella.body_parts_enum.left_hind|block": "left hind",
"stella.body_parts_enum.right_front|block": "right front",
"stella.body_parts_enum.right_hind|block": "right hind",
"stella.joint_enum.upper|block": "upper",
"stella.joint_enum.middle|block": "middle",
"stella.joint_enum.below|block": "below",
"stella.turn_joint_enum.upper|block": "upper(-30~30)",
"stella.turn_joint_enum.middle|block": "middle(-70~90)",
"stella.turn_joint_enum.below|block": "below(-70~50)",
"stella.body_direction_xyz_enum.X|block": "X",
"stella.body_direction_xyz_enum.Y|block": "Y",
"stella.body_direction_xyz_enum.Z|block": "Z",
"stella.translation_xyz_enum.X|block": "X(-35mm~35mm)",
"stella.translation_xyz_enum.Y|block": "Y(-18mm~18mm)",
"stella.translation_xyz_enum.Z|block": "Z(75mm~115mm)",
"stella.execution_action|block": "Execution action %action",
"stella.init_xgo_serial|block": "set STELLA|TX %tx|RX %rx",
"stella.direction_enum.Forward|block": "Forward",
"stella.direction_enum.Backward|block": "Backward",
"stella.direction_enum.Left|block": "Left",
"stella.direction_enum.Right|block": "Right",
"stella.move_xgo|block": "move%direction speed %speed\\%",
"stella.body_height|block": "body height %height\\%",
"stella.rotate_enum.Left|block": "Left",
"stella.rotate_enum.Right|block": "Right",
"stella.rotate|block": "rotate %direction,speed is %speed\\%",
"stella.set_speed_frequency|block": "set %speed_frequency speed to %speed",
"stella.set_servo_angle|block": "set %part leg %joint servo to %angle",
"stella.single_leg|block": "set the X position of the tip of the %part leg to%location_x, Y position to%location_y, Z position to%location_z",
"stella.translational_step|block": "set STELLA to perform a %direction translational motion with a step size of %step mm",
"stella.translational_step_continue|block": "set STELLA to perform a %direction translational motion with a step size of %step mm for %time seconds",
"stella.rotate_angle|block": "set STELLA to perform a %direction rotation at a speed of %speed degrees per second",
"stella.rotate_angle_continue|block": "set STELLA to perform a %direction rotation at a speed of %speed degrees per second for %time seconds",
"stella.leg_lift|block": "set STELLA execution to run in place at a fixed frequency at a leg lift height of %mm mm",
"stella.leg_lift_continue|block": "set STELLA execution to run in place at a fixed frequency at a leg lift height of %mm mm for %time seconds",
"stella.translational_motion|block": "et the STELLA's body to pan %distance mm in the %direction_xyz direction",
"stella.translational_motion_reciprocate|block": "set STELLA to move back and forth in the %direction_xyz direction with a period of %period second",
"stella.translational_motion_reciprocate_stop|block": "stop the periodic translation of STELLA in the %direction_xyz direction",
"stella.rotate_angle_reel|block": "set STELLA to be rotated %angle degrees about the %direction_xyz axis",
"stella.rotate_angle_reel_reciprocate|block": "set STELLA to rotate around the %direction_xyz axis with a period of %period seconds",
"stella.rotate_angle_reel_reciprocate_stop|block": "stop the periodic rotation of STELLA around the %direction_xyz axis",
"stella.gyroscope_switch|block": "%on_off the dynamic balance mode",
"stella.performance_model_switch|block": "%on_off STELLA performance mode",
"stella.servo_switch|block": "%on_off all STELLA servo",
"stella.servo_setting|block": "set STELLA %part leg servo %on_off",
"stella.get_version|block": "get STELLA's version",
"stella.get_electric_quantity|block": "get STELLA's current power",
"stella.get_servo_angle|block": "get the servo Angle of the %joint %part leg joint",
"stella.init_action|block": "restore initial action"
}
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8d05132

Please sign in to comment.