Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V6 beta Upgrade #226

Merged
merged 4 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: javascript

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -48,4 +48,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
1 change: 1 addition & 0 deletions .pxt/storage/auth-opera/user-state
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"json","val":"{\"preferences\":{\"highContrast\":false,\"language\":\"de\",\"reader\":\"\",\"skillmap\":{\"mapProgress\":{},\"completedTags\":{}},\"email\":false},\"profile\":{}}"}
11 changes: 9 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.autoSave": "off",
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/built/**": true,
"**/node_modules/**": true,
"**/yotta_modules/**": true,
"**/yotta_targets": true,
"**/pxt_modules/**": true
},
},
"search.exclude": {
"**/node_modules": true,
"**/yotta_modules/**": true,
"**/yotta_targets": true,
"**/pxt_modules/**": true
},
},
"files.associations": {
"*.blocks": "html",
"*.overrides": "less",
"*.variables": "less",
"*.jres": "json"
},
"tslint.enable": true,
"tslint.rulesDirectory": "node_modules/tslint-microsoft-contrib",
"typescript.tsdk": "./node_modules/typescript/lib"
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,31 @@ cd pxt-common-packages
npm install
cd ..
```
6. Clone this repository.
6. Link pxt-common-packages to pxt
```
npm link ../pxt
cd ..
```
7. Clone this repository.
```
git clone https://github.com/microsoft/pxt-calliope
cd pxt-calliope
```
7. Install the PXT command line (add `sudo` for Mac/Linux shells).
8. Install the PXT command line (add `sudo` for Mac/Linux shells).
```
npm install -g pxt
```
8. Install the pxt-calliope dependencies.
9. Install the pxt-calliope dependencies.
```
npm install
```
8. Link pxt-calliope back to base pxt repo (add `sudo` for Mac/Linux shells).
10. Link pxt-calliope back to base pxt repo (add `sudo` for Mac/Linux shells).
This step is only required if you intend to make changes to pxt and/or
pxt-common-packages repos. If all you want is serve a local Makecode, you can skip
this step.
```
pxt link ../pxt
pxt link ../pxt-common-packages
npm link ../pxt
npm link ../pxt-common-packages
```
Note the above command assumes the folder structure of
```
Expand Down
14 changes: 7 additions & 7 deletions compiler/combiner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ namespace ts.pxtc.extension {
pxtc.compilerHooks.postBinary = (program: ts.Program, opts: CompileOptions, res: CompileResult) => {
if (!opts.target.isNative)
return
const mbdal = res.outfiles["mbdal-binary.hex"]
const mbcodal = res.outfiles["mbcodal-binary.hex"]
if (!mbdal || !mbcodal)
const minidal = res.outfiles["minidal-binary.hex"]
const minicodal = res.outfiles["minicodal-binary.hex"]
if (!minidal || !minicodal)
return

let outp = ""

wrapHex(mbdal, 0x00, [0x99, 0x01, 0xc0, 0xde])
wrapHex(mbcodal, 0x0D, [0x99, 0x03, 0xc0, 0xde], true)
wrapHex(minidal, 0x00, [0x99, 0x00, 0xc0, 0xde])
wrapHex(minicodal, 0x0D, [0x99, 0x03, 0xc0, 0xde], true)

outp += ":00000001FF\n"

Expand Down Expand Up @@ -68,7 +68,7 @@ namespace ts.pxtc.extension {

switch (parsed.type) {
case 0x00:
/*

const parsed2 = parsed.len <= 16 && lines[i + 1] ?
ts.pxtc.hexfile.parseHexRecord(lines[i + 1])
: null
Expand All @@ -80,7 +80,7 @@ namespace ts.pxtc.extension {
parsed.len += parsed2.len
i++
}
*/

addData([parsed.addr >> 8, parsed.addr & 0xff, dataType]
.concat(parsed.data))
break
Expand Down
2 changes: 1 addition & 1 deletion compiler/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"declaration": true,
"moduleResolution": "node",
"isolatedModules": false,
"out": "../built/compiler.js",
"outFile": "../built/compiler.js",
"rootDir": ".",
"newLine": "LF",
"sourceMap": false,
Expand Down
19 changes: 19 additions & 0 deletions docs/boards.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Boards

This editor supports various calliope boards.

## Current

### ~ codecard

* name: mini 1
* url: /boards/calliope-mini-1
* imageUrl: /calliope/templates/16KB.png

---

* name: mini 2
* url: /boards/calliope-mini-2
* imageUrl: /calliope/templates/32KB.png

### ~
6 changes: 6 additions & 0 deletions docs/boards/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Boards

* [Calliope](/boards/calliope)
* [Calliope mini Ref. 1.x](/boards/calliope-mini-1)
* [Calliope mini Ref. 2](/boards/calliope-mini-2)

9 changes: 9 additions & 0 deletions docs/boards/calliope-mini-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Calliope mini v1

```sim
basic.showString("mini 1")
```

```package
mini-1
```
9 changes: 9 additions & 0 deletions docs/boards/calliope-mini-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Calliope mini v2

```sim
basic.showString("mini 2")
```

```package
mini-2
```
19 changes: 19 additions & 0 deletions docs/boards/calliope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Calliope

## mini

### ~ codecard

* name: v1
* url: /boards/calliope-mini-1
* cardType: template
* imageUrl: /calliope/templates/16KB.png

---

* name: v2
* url: /boards/calliope-mini-2
* cardType: template
* imageUrl: /calliope/templates/32KB.png

### ~
11 changes: 10 additions & 1 deletion docs/calliope/firststeps/Decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,13 @@ After the if…then block the program continues in any case, no matter whether t
### If – then – else
If you expand the if…then block, the first if condition is checked first, if it is not fulfilled the second if condition is checked. Only those actions are triggered for which the associated condition is fulfilled.

Click on the + on the bottom of the block to unfold the if…then block. The probability to display either a happy or a sad smiley on the LED grid is 50/50.
Click on the + on the bottom of the block to unfold the if…then block. The probability to display either a happy or a sad smiley on the LED grid is 50/50.

```blocks
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
```
11 changes: 10 additions & 1 deletion docs/calliope/firststeps/Inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,13 @@ Your text will be displayed when pin – and pin 0 are both pressed at the same
### Various input
You can program the Calliope mini to respond to more than one input. There are two possible ways of doing this:
You can use indiviual events separated from each other with different actions to run after that condition is met.
Nevertheless, you can also use an "if" or "while" condition (from the Logic and Loops sections) and wait for your inputs to be met.
Nevertheless, you can also use an "if" or "while" condition (from the Logic and Loops sections) and wait for your inputs to be met.

```blocks
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
```
11 changes: 10 additions & 1 deletion docs/calliope/firststeps/Loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,13 @@ Everything inside will be repeated forever.
Of course, you can also specify how often something should be repeated:

### Repeat block
Use the „on start“ block or any other block that usually initiates a one time cycle. Take the "Repeat 4 times" block from the Loops section and enter the desired number in the number field. Whatever task is within this block will be executed for the number of times you entered within the “Repeat …“ number.
Use the „on start“ block or any other block that usually initiates a one time cycle. Take the "Repeat 4 times" block from the Loops section and enter the desired number in the number field. Whatever task is within this block will be executed for the number of times you entered within the “Repeat …“ number.

```blocks
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
```
11 changes: 10 additions & 1 deletion docs/calliope/firststeps/Mathematics.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@ You can find the required block in the menu Math. From the block's drop-down lis
## Step 2 @fullscreen

### Random numbers
You can have Calliope mini create a random number: You can find the corresponding block in the menu Math ("pick random 0 to 10"). By changing the two numbers within the block, you determine how small or how large the random number is allowed to become.
You can have Calliope mini create a random number: You can find the corresponding block in the menu Math ("pick random 0 to 10"). By changing the two numbers within the block, you determine how small or how large the random number is allowed to become.

```blocks
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
```
11 changes: 10 additions & 1 deletion docs/calliope/firststeps/Output.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,13 @@ To turn the LED off, you can use the "turn build-in led off“ block or put the
## Step 3 @fullscreen

### The speaker
You can play individual notes or music pieces. Simply open the Music section and drag the "play tone 262 Hz for 1 beat“ and chance the value of the tone to see how you can adjust the height of the note.
You can play individual notes or music pieces. Simply open the Music section and drag the "play tone 262 Hz for 1 beat“ and chance the value of the tone to see how you can adjust the height of the note.

```blocks
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
```
11 changes: 10 additions & 1 deletion docs/calliope/firststeps/Radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,13 @@ To send a message you should select the "radio send string“ block. Now you can
Set the same channel as on the sending Calliope mini one.
Use the "on radio received receivedString“ block to look for data.
Include the "show string receivedString“ inside.
Let’s try with two (or more) Calliope mini!
Let’s try with two (or more) Calliope mini!

```blocks
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
```
11 changes: 10 additions & 1 deletion docs/calliope/firststeps/Sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,13 @@ The built in magnetometer allows the Calliope mini to tell in which direction it
## Step 4 @fullscreen

### Temperature sensor
You can select the temperature sensor by dragging the block from the Input section into the number block.
You can select the temperature sensor by dragging the block from the Input section into the number block.

```blocks
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
```
11 changes: 10 additions & 1 deletion docs/calliope/firststeps/Variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,13 @@ You can find a separate block for each variable, which you can use to display it
## Step 3 @fullscreen

### Count your score
By combining what you have learned so far, you can program a simple score counter: When button A is pressed, the number of goals variable is increased by one numerical value and then displayed. Have a try!
By combining what you have learned so far, you can program a simple score counter: When button A is pressed, the number of goals variable is increased by one numerical value and then displayed. Have a try!

```blocks
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
```
11 changes: 10 additions & 1 deletion docs/calliope/firststeps/firstSteps.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,13 @@ You can now play arround or try some of our other guided first-steps tutorials..

[Play with colors and sound](#tutorial:/calliope/firststeps/Output)

[See how to Controll your mini with the buttons and pins](#tutorial:/calliope/firststeps/Inputs)
[See how to Controll your mini with the buttons and pins](#tutorial:/calliope/firststeps/Inputs)

```blocks
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
```
22 changes: 0 additions & 22 deletions docs/calliope/neu.md

This file was deleted.

Loading
Loading