Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d57b67e52e | ||
|
|
79517f8a30 | ||
|
|
17b1953889 | ||
|
|
33e6fbbcb2 | ||
|
|
9a7bf30e80 | ||
|
|
c588c6178f | ||
|
|
11fea05486 | ||
|
|
f5e1e238f2 | ||
|
|
17b5cb71cb | ||
|
|
51ea620578 |
39
.github/workflows/pxt-buildtarget.yml
vendored
Normal file
39
.github/workflows/pxt-buildtarget.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: pxt-buildtarget
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
create:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [8.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: |
|
||||
sudo apt-get install xvfb
|
||||
sudo npm install -g pxt
|
||||
npm install
|
||||
- name: pxt ci
|
||||
run: |
|
||||
pxt ci
|
||||
env:
|
||||
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
|
||||
PXT_ACCESS_TOKEN: ${{ secrets.PXT_ACCESS_TOKEN }}
|
||||
PXT_RELEASE_REPO: ${{ secrets.PXT_RELEASE_REPO }}
|
||||
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
|
||||
CHROME_BIN: chromium-browser
|
||||
DISPLAY: :99.0
|
||||
CI: true
|
||||
@@ -439,6 +439,7 @@
|
||||
"input.runningTimeMicros": "Gets the number of microseconds elapsed since power on.",
|
||||
"input.setAccelerometerRange": "Sets the accelerometer sample range in gravities.",
|
||||
"input.setAccelerometerRange|param|range": "a value describe the maximum strengh of acceleration measured",
|
||||
"input.soundLevel": "gets the level of loudness in 0-100%",
|
||||
"input.temperature": "Gets the temperature in Celsius degrees (°C).",
|
||||
"led": "Control of the LED screen.",
|
||||
"led.brightness": "Get the screen brightness from 0 (off) to 255 (full bright).",
|
||||
|
||||
@@ -327,6 +327,7 @@
|
||||
"input.runningTimeMicros|block": "running time (micros)",
|
||||
"input.runningTime|block": "running time (ms)",
|
||||
"input.setAccelerometerRange|block": "set accelerometer|range %range",
|
||||
"input.soundLevel|block": "Loudness",
|
||||
"input.temperature|block": "temperature (°C)",
|
||||
"input|block": "input",
|
||||
"led.brightness|block": "brightness",
|
||||
|
||||
2
libs/core/enums.d.ts
vendored
2
libs/core/enums.d.ts
vendored
@@ -470,10 +470,8 @@ declare namespace motors {
|
||||
|
||||
|
||||
declare const enum AnalogPin {
|
||||
P0 = 112, // MICROBIT_ID_IO_P12
|
||||
P1 = 100, // MICROBIT_ID_IO_P0
|
||||
P2 = 101, // MICROBIT_ID_IO_P1
|
||||
P3 = 116, // MICROBIT_ID_IO_P16
|
||||
C4 = 103, // MICROBIT_ID_IO_P3
|
||||
C5 = 104, // MICROBIT_ID_IO_P4
|
||||
C6 = 110, // MICROBIT_ID_IO_P10
|
||||
|
||||
@@ -200,7 +200,7 @@ namespace music {
|
||||
//% group="Tone"
|
||||
export function playTone(frequency: number, ms: number): void {
|
||||
if (_playTone) _playTone(frequency, ms);
|
||||
else pins.analogPitch(frequency, ms);
|
||||
else speakerPlayTone(frequency, ms);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace pins {
|
||||
|
||||
/**
|
||||
* Read the specified pin or connector as either 0 or 1
|
||||
* @param name pin to read from, eg: DigitalPin.P0
|
||||
* @param name pin to read from, eg: DigitalPin.P1
|
||||
*/
|
||||
//% help=pins/digital-read-pin weight=30
|
||||
//% blockId=device_get_digital_pin block="digital read|pin %name" blockGap=8
|
||||
@@ -124,7 +124,7 @@ namespace pins {
|
||||
|
||||
/**
|
||||
* Set a pin or connector value to either 0 or 1.
|
||||
* @param name pin to write to, eg: DigitalPin.P0
|
||||
* @param name pin to write to, eg: DigitalPin.P1
|
||||
* @param value value to set on the pin, 1 eg,0
|
||||
*/
|
||||
//% help=pins/digital-write-pin weight=29
|
||||
@@ -138,7 +138,7 @@ namespace pins {
|
||||
|
||||
/**
|
||||
* Read the connector value as analog, that is, as a value comprised between 0 and 1023.
|
||||
* @param name pin to write to, eg: AnalogPin.P0
|
||||
* @param name pin to write to, eg: AnalogPin.P1
|
||||
*/
|
||||
//% help=pins/analog-read-pin weight=25
|
||||
//% blockId=device_get_analog_pin block="analog read|pin %name" blockGap="8"
|
||||
@@ -150,7 +150,7 @@ namespace pins {
|
||||
|
||||
/**
|
||||
* Set the connector value as analog. Value must be comprised between 0 and 1023.
|
||||
* @param name pin name to write to, eg: AnalogPin.P0
|
||||
* @param name pin name to write to, eg: AnalogPin.P1
|
||||
* @param value value to write to the pin between ``0`` and ``1023``. eg:1023,0
|
||||
*/
|
||||
//% help=pins/analog-write-pin weight=24
|
||||
@@ -165,7 +165,7 @@ namespace pins {
|
||||
/**
|
||||
* Configure the pulse-width modulation (PWM) period of the analog output in microseconds.
|
||||
* If this pin is not configured as an analog output (using `analog write pin`), the operation has no effect.
|
||||
* @param name analog pin to set period to, eg: AnalogPin.P0
|
||||
* @param name analog pin to set period to, eg: AnalogPin.P1
|
||||
* @param micros period in micro seconds. eg:20000
|
||||
*/
|
||||
//% help=pins/analog-set-period weight=23 blockGap=8
|
||||
@@ -178,7 +178,7 @@ namespace pins {
|
||||
|
||||
/**
|
||||
* Configure the pin as a digital input and generate an event when the pin is pulsed either high or low.
|
||||
* @param name digital pin to register to, eg: DigitalPin.P0
|
||||
* @param name digital pin to register to, eg: DigitalPin.P1
|
||||
* @param pulse the value of the pulse, eg: PulseValue.High
|
||||
*/
|
||||
//% help=pins/on-pulsed weight=22 blockGap=16 advanced=true
|
||||
@@ -205,7 +205,7 @@ namespace pins {
|
||||
|
||||
/**
|
||||
* Return the duration of a pulse at a pin in microseconds.
|
||||
* @param name the pin which measures the pulse, eg: DigitalPin.P0
|
||||
* @param name the pin which measures the pulse, eg: DigitalPin.P1
|
||||
* @param value the value of the pulse, eg: PulseValue.High
|
||||
* @param maximum duration in microseconds
|
||||
*/
|
||||
@@ -248,7 +248,7 @@ namespace pins {
|
||||
|
||||
/**
|
||||
* Write a value to the servo, controlling the shaft accordingly. On a standard servo, this will set the angle of the shaft (in degrees), moving the shaft to that orientation. On a continuous rotation servo, this will set the speed of the servo (with ``0`` being full-speed in one direction, ``180`` being full speed in the other, and a value near ``90`` being no movement).
|
||||
* @param name pin to write to, eg: AnalogPin.P0
|
||||
* @param name pin to write to, eg: AnalogPin.P1
|
||||
* @param value angle or rotation speed, eg:180,90,0
|
||||
*/
|
||||
//% help=pins/servo-write-pin weight=20
|
||||
@@ -342,7 +342,7 @@ namespace pins {
|
||||
void analogPitch(int frequency, int ms) {
|
||||
// init pins if needed
|
||||
if (NULL == pitchPin) {
|
||||
pitchPin = getPin((int)AnalogPin::P0);
|
||||
pitchPin = getPin((int)DigitalPin::P1);
|
||||
#ifdef SOUND_MIRROR_EXTENSION
|
||||
pitchPin2 = &SOUND_MIRROR_EXTENSION;
|
||||
#endif
|
||||
@@ -366,7 +366,7 @@ namespace pins {
|
||||
|
||||
/**
|
||||
* Configure the pull directiion of of a pin.
|
||||
* @param name pin to set the pull mode on, eg: DigitalPin.P0
|
||||
* @param name pin to set the pull mode on, eg: DigitalPin.P1
|
||||
* @param pull one of the mbed pull configurations, eg: PinPullMode.PullUp
|
||||
*/
|
||||
//% help=pins/set-pull weight=3 advanced=true
|
||||
@@ -392,7 +392,7 @@ namespace pins {
|
||||
/**
|
||||
* Configure the events emitted by this pin. Events can be subscribed to
|
||||
* using ``control.onEvent()``.
|
||||
* @param name pin to set the event mode on, eg: DigitalPin.P0
|
||||
* @param name pin to set the event mode on, eg: DigitalPin.P1
|
||||
* @param type the type of events for this pin to emit, eg: PinEventType.Edge
|
||||
*/
|
||||
//% help=pins/set-events weight=4 advanced=true
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
"input": "Events and data from sensors",
|
||||
"input.onLoudSound": "Registers an event that runs when a loud sound is detected",
|
||||
"input.setLoudSoundThreshold": "Sets the minimum threshold for a loud sound",
|
||||
"input.soundLevel": "Reads the loudness through the microphone from 0 (silent) to 255 (loud)"
|
||||
"input.soundLevel": "gets the level of loudness in 0-100%\n\nReads the loudness through the microphone from 0 (silent) to 255 (loud)"
|
||||
}
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pxt-calliope",
|
||||
"version": "3.0.23",
|
||||
"version": "3.0.27",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pxt-calliope",
|
||||
"version": "3.0.23",
|
||||
"version": "3.0.27",
|
||||
"description": "micro:bit target for Microsoft MakeCode (PXT)",
|
||||
"keywords": [
|
||||
"JavaScript",
|
||||
@@ -46,6 +46,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"pxt-common-packages": "7.0.4",
|
||||
"pxt-core": "6.0.20"
|
||||
"pxt-core": "6.0.23"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
"deployDrives": "MINI",
|
||||
"driveName": "MINI",
|
||||
"hexMimeType": "application/x-microbit-hex",
|
||||
"moveHexEof": true,
|
||||
"openocdScript": "source [find interface/cmsis-dap.cfg]; source [find target/nrf51.cfg]",
|
||||
"flashUsableEnd": 242688,
|
||||
"flashEnd": 242688,
|
||||
@@ -456,5 +457,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"uploadDocs": true
|
||||
"uploadDocs": true,
|
||||
"ignoreDocsErrors": true
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ function readSensor(): number {
|
||||
// Produce a sensor value in range 0..1023
|
||||
if (sensorType == "ANALOG") {
|
||||
// Input range is 0..1023
|
||||
value = pins.analogReadPin(AnalogPin.P0)
|
||||
value = pins.analogReadPin(AnalogPin.P1)
|
||||
} else if (sensorType == "TILT") {
|
||||
// Input range is -1024 (pads highest)..1023 (pads lowest)
|
||||
value = input.acceleration(Dimension.Y)
|
||||
|
||||
Reference in New Issue
Block a user