forked from microsoft/pxt-ev3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit, based on pxt-adafruit
- Loading branch information
0 parents
commit 207e7a0
Showing
133 changed files
with
1,670 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
BasedOnStyle: LLVM | ||
IndentWidth: 4 | ||
UseTab: Never | ||
ColumnLimit: 100 | ||
AllowShortFunctionsOnASingleLine: Inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# enforce unix style line endings | ||
*.ts text eol=lf | ||
*.tsx text eol=lf | ||
*.md text eol=lf | ||
*.txt text eol=lf | ||
*.js text eol=lf | ||
*.json text eol=lf | ||
*.xml text eol=lf | ||
*.svg text eol=lf | ||
*.yaml text eol=lf | ||
*.css text eol=lf | ||
*.html text eol=lf | ||
*.py text eol=lf | ||
*.exp text eol=lf | ||
*.manifest text eol=lf | ||
|
||
# do not enforce text for everything - it causes issues with random binary files | ||
|
||
*.sln text eol=crlf | ||
|
||
*.png binary | ||
*.jpg binary | ||
*.jpeg binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
node_modules | ||
yotta_modules | ||
yotta_targets | ||
pxt_modules | ||
built | ||
typings | ||
tmp | ||
temp | ||
projects/** | ||
clients/win10/app/AppPackages | ||
clients/win10/app/BundlePackages | ||
clients/win10/app/BundleArtifacts | ||
clients/win10/app/bin | ||
clients/win10/app/bld | ||
clients/win10/*.opendb | ||
clients/**/bin/** | ||
clients/**/obj/** | ||
clients/electron/projects | ||
|
||
videos/** | ||
|
||
*.user | ||
*.sw? | ||
*.ts.new | ||
*.tgz | ||
*.db | ||
*.suo | ||
*.log | ||
.pioenvs | ||
.piolibdeps | ||
lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Contributing Code | ||
|
||
This repo accepts bug fix pull requests. For a bug fix PR to be accepted, it must first have a tracking issue that has been marked approved. Your PR should link to the bug you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort. | ||
|
||
This repo also accepts new feature pull requests. For a feature-level PR to be accepted, it first needs to have design discussion. Design discussion can take one of two forms a) a feature request in the issue tracker that has been marked as approved or b) the PR must be accompanied by a full design spec and this spec is later approved in the open design discussion. Features are evaluated against their complexity, impact on other features, roadmap alignment, and maintainability. | ||
|
||
These two blogs posts on contributing code to open source projects are a good reference: [Open Source Contribution Etiquette](http://tirania.org/blog/archive/2010/Dec-31.html) by Miguel de Icaza and [Don't "Push" Your Pull Requests](https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/) by Ilya Grigorik. | ||
|
||
## Security | ||
|
||
If you believe you have found a security issue here, please share it with us privately following the guidance at the Microsoft [Security TechCenter](https://technet.microsoft.com/en-us/security/ff852094). Reporting it via this channel helps minimize risk to projects built with this repo. | ||
|
||
## Legal | ||
|
||
You will need to complete a Contributor License Agreement (CLA) before your pull request can be accepted. This agreement testifies that you are granting us permission to use the source code you are submitting, and that this work is being submitted under appropriate license that we can use it. | ||
|
||
You can complete the CLA by going through the steps at https://cla.microsoft.com. Once we have received the signed CLA, we'll review the request. You will only need to do this once. | ||
|
||
## Housekeeping | ||
|
||
Your pull request should: | ||
* Include a description of what your change intends to do | ||
* Be a child commit of a reasonably recent commit in the master branch | ||
* Pass all unit tests | ||
* Have a clear commit message | ||
* Include adequate tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
PXT-EV3 | ||
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) Microsoft Corporation | ||
|
||
All rights reserved. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# LEGO Mindstorms EV3 target for PXT | ||
|
||
[](https://ci2.dot.net/job/Private/job/pxt_project_pink/job/master/job/pxt-ev3_Push/) | ||
|
||
This repo contains the editor target hosted at https://lego.makecode.com | ||
|
||
## Local Dev setup | ||
|
||
These instructions assume familiarity with dev tools and languages. | ||
|
||
* install Node.js 6+ | ||
* install [yotta](http://docs.yottabuild.org/#installing) | ||
* (optional) install [Visual Studio Code](https://code.visualstudio.com/) | ||
|
||
In a common folder, | ||
|
||
* clone https://github.com/Microsoft/pxt to ``pxt`` folder | ||
* clone https://github.com/Microsoft/pxt-common-packages to ``pxt-common-packages`` folder | ||
* clone https://github.com/Microsoft/pxt-ev3 to ``pxt-ev3`` folder | ||
* go to ``pxt`` and run | ||
|
||
``` | ||
npm install | ||
typings install | ||
``` | ||
|
||
* go to ``pxt-common-packages`` and run | ||
|
||
``` | ||
npm install | ||
npm link ../pxt | ||
``` | ||
|
||
* go to ``pxt-ev3`` and run | ||
|
||
``` | ||
npm install | ||
npm link ../pxt | ||
npm link ../pxt-common-packages | ||
``` | ||
|
||
## to run the local server | ||
|
||
From root github folder, | ||
|
||
``` | ||
cd pxt-ev3 | ||
pxt serve --cloud | ||
``` | ||
|
||
## to build and deploy a single package via command line | ||
|
||
``` | ||
cd libs/core | ||
pxt deploy | ||
``` | ||
|
||
## Jenkins build | ||
|
||
https://ci2.dot.net/job/Private/job/pxt_project_pink/job/master/ | ||
|
||
## License | ||
MIT | ||
|
||
## Code of Conduct | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*!----------------- PXT ThirdPartyNotices ------------------------------------------------------- | ||
|
||
PXT uses third party material from the projects listed below. | ||
The original copyright notice and the license under which Microsoft | ||
received such third party material are set forth below. Microsoft | ||
reserves all other rights not expressly granted, whether by | ||
implication, estoppel or otherwise. | ||
|
||
In the event that we accidentally failed to list a required notice, please | ||
bring it to our attention. Post an issue or email us: | ||
|
||
[email protected] | ||
|
||
--------------------------------------------- | ||
Third Party Code Components | ||
--------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// <reference path="../node_modules/pxt-core/typings/globals/node/index.d.ts"/> | ||
/// <reference path="../node_modules/pxt-core/built/pxtlib.d.ts" /> | ||
|
||
import * as path from "path"; | ||
export let pxtCore = require("pxt-core"); | ||
// require.resolve() gives path to [pxt dir]/built/pxt.js, so move up twice to get pxt root dir | ||
export let pxtCoreDir = path.resolve(require.resolve("pxt-core"), "..", ".."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"noImplicitAny": true, | ||
"noImplicitReturns": true, | ||
"declaration": true, | ||
"outDir": "../built", | ||
"module": "commonjs", | ||
"rootDir": ".", | ||
"newLine": "LF", | ||
"sourceMap": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# @extends | ||
|
||
## Reference #reference | ||
|
||
* [Reference](/reference) | ||
* [input](/reference/input) | ||
* [light](/reference/light) | ||
* [music](/reference/music) | ||
* [pins](/reference/pins) | ||
* [control](/reference/control) | ||
* [serial](/reference/serial) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# About | ||
|
||
Welcome to the **Microsoft MakeCode** editor for the **@boardname@**! | ||
|
||
## Programming: [Blocks](/blocks) or [JavaScript](/javascript) | ||
|
||
You can program the @boardname@ using [Blocks](/blocks) or [JavaScript](/javascript) in your web browser: | ||
|
||
```block | ||
input.buttonA.onEvent(ButtonEvent.Click, () => { | ||
light.showRing(`blue blue blue blue blue blue blue blue blue blue`) | ||
}) | ||
``` | ||
```typescript | ||
input.buttonA.onEvent(ButtonEvent.Click, () => { | ||
light.showRing(`blue blue blue blue blue blue blue blue blue blue`) | ||
}) | ||
``` | ||
|
||
The editor work in [most modern browsers](/browsers), work [offline](/offline) once loaded and do not require any installation. | ||
|
||
## [Compile and Flash: Your Program!](/device/usb) | ||
|
||
When you have your code ready, you connect your @boardname@ to a computer via a USB cable | ||
**then press the reset button** so it appears as a mounted drive (named **CPLAYBOOT**). | ||
|
||
Compilation to machine code from [Blocks](/blocks) or [JavaScript](/javascript) happens in the browser. You save the binary | ||
program to a **.uf2** file, which you then copy to the **CPLAYBOOT** drive, which flashes the device with the new program. | ||
|
||
## Simulator: Test Your Code | ||
|
||
You can run your code using the micro:bit simulator, all within the confines of a web browser. | ||
The simulator has support for the LED screen, buttons, as well as compass, accelerometer, and digital I/O pins. | ||
|
||
```sim | ||
loops.forever(() => { | ||
light.pixels.showAnimation(light.animation(LightAnimation.Rainbow), 1000) | ||
}) | ||
``` | ||
|
||
```package | ||
light | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"appref": "v" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# @extends | ||
|
||
### #specific | ||
|
||
```cards | ||
loops.forever(() => {}); | ||
loops.pause(0) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Documentation | ||
|
||
### @description Links to the documentation, reference and projects. | ||
|
||
Welcome to the documentation of the Microsoft MakeCode editor | ||
for the @boardname@. | ||
|
||
## Documentation | ||
|
||
* [About](/about) | ||
* [Examples](/examples) | ||
* [Blocks](/blocks) | ||
* [JavaScript](/javascript) | ||
* [Reference](/reference) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Examples | ||
|
||
Here are some fun programs for your @boardname@! | ||
|
||
## Fun stuff | ||
|
||
|
||
Coming soon. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"appref": "v" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Projects | ||
|
||
Here are some cool projects that you can build with your @boardname@! | ||
|
||
## Basic | ||
|
||
Basic projects to build with your @boardname@. | ||
|
||
Coming soon. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Reference | ||
|
||
```namespaces | ||
input.onGesture(Gesture.Shake, () => {}) | ||
light.showRing('red red red red red red red red red red') | ||
music.playTone(0, 0) | ||
pins.pulseDuration() | ||
control.runInBackground(() => {}) | ||
serial.writeLine(""); | ||
``` | ||
|
||
## See Also | ||
|
||
[blocks](/blocks), [JavaScript](/javascript), [input](/reference/input), [light](/reference/light), [music](/reference/music), | ||
[control](/reference/control), [pins](/reference/pins), [serial](/reference/serial) | ||
|
||
```package | ||
circuit-playground | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import jobs.generation.Utilities; | ||
import jobs.generation.InternalUtilities; | ||
|
||
def project = GithubProject | ||
def projectName = "pxt-ev3" | ||
|
||
[true, false].each { isPR -> | ||
def newJobName = projectName | ||
|
||
if (isPR) { | ||
newJobName += "_PR" | ||
} else { | ||
newJobName += "_Push" | ||
} | ||
|
||
def newJob = job(newJobName) { | ||
steps { | ||
shell("chmod +x ./jenkins.sh") | ||
shell("./jenkins.sh ${isPR}") | ||
} | ||
|
||
if (!isPR) { | ||
wrappers { | ||
credentialsBinding { | ||
string("PXT_ACCESS_TOKEN", "pxt_access_token") | ||
string("PXT_RELEASE_REPO", "pxt_release_repo_ev3") | ||
} | ||
} | ||
} | ||
} | ||
|
||
Utilities.setMachineAffinity(newJob, "Ubuntu", "20161020") | ||
InternalUtilities.standardJobSetup(newJob, project, isPR, "*/*") | ||
|
||
if (isPR) { | ||
Utilities.addGithubPRTrigger(newJob, "Default Testing") | ||
} else { | ||
Utilities.addGithubPushTrigger(newJob) | ||
} | ||
} |
Oops, something went wrong.