Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c37bea54a | ||
|
|
b653e54917 |
@@ -1,18 +0,0 @@
|
|||||||
# exit Program
|
|
||||||
|
|
||||||
Stops the program and returns to the brick menu
|
|
||||||
|
|
||||||
```sig
|
|
||||||
brick.exitProgram();
|
|
||||||
```
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
Do a sequence of motor commands and stop the program.
|
|
||||||
|
|
||||||
```blocks
|
|
||||||
motors.largeA.run(50)
|
|
||||||
pause(500)
|
|
||||||
motors.stopAll()
|
|
||||||
brick.exitProgram();
|
|
||||||
```
|
|
||||||
@@ -26,7 +26,6 @@ namespace brick {
|
|||||||
*/
|
*/
|
||||||
//% blockId=brickBatteryProperty block="battery %property"
|
//% blockId=brickBatteryProperty block="battery %property"
|
||||||
//% group="Battery"
|
//% group="Battery"
|
||||||
//% blockGap=8
|
|
||||||
//% help=brick/battery-property
|
//% help=brick/battery-property
|
||||||
export function batteryInfo(property: BatteryProperty): number {
|
export function batteryInfo(property: BatteryProperty): number {
|
||||||
const info = sensors.internal.getBatteryInfo();
|
const info = sensors.internal.getBatteryInfo();
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace brick {
|
|||||||
//% blockId=buttonIsPressed
|
//% blockId=buttonIsPressed
|
||||||
//% parts="brick"
|
//% parts="brick"
|
||||||
//% blockNamespace=brick
|
//% blockNamespace=brick
|
||||||
//% weight=81
|
//% weight=81 blockGap=8
|
||||||
//% group="Buttons"
|
//% group="Buttons"
|
||||||
//% button.fieldEditor="brickbuttons"
|
//% button.fieldEditor="brickbuttons"
|
||||||
isPressed() {
|
isPressed() {
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
#include "pxt.h"
|
#include "pxt.h"
|
||||||
#include "ev3const.h"
|
#include "ev3const.h"
|
||||||
|
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
namespace output {
|
namespace output {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,6 +20,7 @@ Buffer createBuffer(int size) {
|
|||||||
namespace pxt {
|
namespace pxt {
|
||||||
|
|
||||||
void target_init() {
|
void target_init() {
|
||||||
|
mkdir(SETTINGSDIR, 0777);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
#define PXT_GC_THREAD_LIST 1
|
#define PXT_GC_THREAD_LIST 1
|
||||||
|
|
||||||
#define PXT_IN_ISR() false
|
#define PXT_IN_ISR() false
|
||||||
|
|
||||||
|
#define SETTINGSDIR "/mnt/ramdisk/settings"
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
namespace brick {
|
|
||||||
/**
|
|
||||||
* Exits the program to the main menu. (in the simulator restarts it)
|
|
||||||
*/
|
|
||||||
//% blockId=loopstop block="exit program"
|
|
||||||
//% help=reference/brick/exit-program
|
|
||||||
//% weight=10
|
|
||||||
//% blockGap=8
|
|
||||||
//% group="Buttons"
|
|
||||||
export function exitProgram() {
|
|
||||||
control.reset();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
//% color="#68C3E2" weight=100 icon="\uf106"
|
//% color="#68C3E2" weight=100 icon="\uf106"
|
||||||
//% groups='["Buttons", "Screen", "Power"]'
|
//% groups='["Buttons", "Screen", "Battery"]'
|
||||||
//% labelLineWidth=60
|
//% labelLineWidth=60
|
||||||
namespace brick {
|
namespace brick {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,8 @@
|
|||||||
"name": "ev3",
|
"name": "ev3",
|
||||||
"description": "The EV3 library",
|
"description": "The EV3 library",
|
||||||
"files": [
|
"files": [
|
||||||
"README.md",
|
"README.md",
|
||||||
"ns.ts",
|
"ns.ts",
|
||||||
"brick.ts",
|
|
||||||
"startup.ts",
|
"startup.ts",
|
||||||
"images.jres",
|
"images.jres",
|
||||||
"images.ts",
|
"images.ts",
|
||||||
@@ -24,7 +23,8 @@
|
|||||||
"touch-sensor": "file:../touch-sensor",
|
"touch-sensor": "file:../touch-sensor",
|
||||||
"ultrasonic-sensor": "file:../ultrasonic-sensor",
|
"ultrasonic-sensor": "file:../ultrasonic-sensor",
|
||||||
"gyro-sensor": "file:../gyro-sensor",
|
"gyro-sensor": "file:../gyro-sensor",
|
||||||
"infrared-sensor": "file:../infrared-sensor"
|
"infrared-sensor": "file:../infrared-sensor",
|
||||||
|
"settings": "file:../settings"
|
||||||
},
|
},
|
||||||
"palette": [
|
"palette": [
|
||||||
"#ffffff",
|
"#ffffff",
|
||||||
|
|||||||
4
libs/settings/pxt.json
Normal file
4
libs/settings/pxt.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"name": "settings",
|
||||||
|
"additionalFilePath": "../../node_modules/pxt-common-packages/libs/settings---files"
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pxt-ev3",
|
"name": "pxt-ev3",
|
||||||
"version": "1.4.3",
|
"version": "1.4.2",
|
||||||
"description": "LEGO MINDSTORMS EV3 for Microsoft MakeCode",
|
"description": "LEGO MINDSTORMS EV3 for Microsoft MakeCode",
|
||||||
"private": false,
|
"private": false,
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@@ -18,7 +18,8 @@
|
|||||||
"libs/screen",
|
"libs/screen",
|
||||||
"libs/ev3",
|
"libs/ev3",
|
||||||
"libs/storage",
|
"libs/storage",
|
||||||
"libs/broadcast"
|
"libs/broadcast",
|
||||||
|
"libs/settings"
|
||||||
],
|
],
|
||||||
"simulator": {
|
"simulator": {
|
||||||
"autoRun": true,
|
"autoRun": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user