moving gyro into separate project

This commit is contained in:
Peli de Halleux 2017-11-30 10:34:34 -08:00
parent 3d29c5e323
commit 3c675892aa
9 changed files with 23 additions and 14 deletions

View File

@ -70,8 +70,6 @@
"screen.clear": "Clear screen and reset font to normal.",
"screen.imageOf": "Makes an image bound to a buffer.",
"screen.unpackPNG": "Decompresses a 1-bit gray scale PNG image to image format.",
"sensors.GyroSensor.angle": "Get the current angle from the gyroscope.",
"sensors.GyroSensor.rate": "Get the current rotation rate from the gyroscope.",
"serial": "Reading and writing data over a serial connection.",
"serial.writeDmesg": "Send DMESG debug buffer over serial."
}

View File

@ -55,12 +55,6 @@
"motors|block": "motors",
"output|block": "output",
"screen|block": "screen",
"sensors.GyroSensor.angle|block": "`icons.gyroSensor` %sensor|angle",
"sensors.GyroSensor.rate|block": "`icons.gyroSensor` %sensor|rotation rate",
"sensors.gyro1|block": "1",
"sensors.gyro2|block": "2",
"sensors.gyro3|block": "3",
"sensors.gyro4|block": "4",
"serial|block": "serial",
"{id:category}Brick": "Brick",
"{id:category}Control": "Control",
@ -70,10 +64,8 @@
"{id:category}Motors": "Motors",
"{id:category}Output": "Output",
"{id:category}Screen": "Screen",
"{id:category}Sensors": "Sensors",
"{id:category}Serial": "Serial",
"{id:group}Buttons": "Buttons",
"{id:group}Gyro Sensor": "Gyro Sensor",
"{id:group}Light": "Light",
"{id:group}Motors": "Motors",
"{id:group}Screen": "Screen"

View File

@ -18,7 +18,6 @@
"output.ts",
"core.ts",
"input.ts",
"gyro.ts",
"shims.d.ts",
"enums.d.ts",
"dal.d.ts",

View File

@ -12,7 +12,8 @@
"color-sensor": "file:../color-sensor",
"touch-sensor": "file:../touch-sensor",
"ultrasonic-sensor": "file:../ultrasonic-sensor",
"infrared-sensor": "file:../infrared-sensor"
"infrared-sensor": "file:../infrared-sensor",
"gyro-sensor": "file:../gyro-sensor"
},
"public": true
}

View File

@ -0,0 +1,3 @@
# Gyroscope
The library to interact with the Gyroscope.

View File

@ -30,7 +30,7 @@ namespace sensors {
//% blockNamespace=sensors
//% weight=65 blockGap=8
//% group="Gyro Sensor"
angle() {
angle(): number {
this.setMode(GyroSensorMode.Angle)
return this.getNumber(NumberFormat.Int16LE, 0)
}
@ -46,7 +46,7 @@ namespace sensors {
//% blockNamespace=sensors
//% weight=65 blockGap=8
//% group="Gyro Sensor"
rate() {
rate(): number {
this.setMode(GyroSensorMode.Rate)
return this.getNumber(NumberFormat.Int16LE, 0)
}

15
libs/gyro-sensor/pxt.json Normal file
View File

@ -0,0 +1,15 @@
{
"name": "gyro-sensor",
"description": "Gyroscope support",
"files": [
"README.md",
"gyro.ts"
],
"testFiles": [
"test.ts"
],
"public": true,
"dependencies": {
"core": "file:../core"
}
}

0
libs/gyro-sensor/test.ts Normal file
View File

View File

@ -14,6 +14,7 @@
"libs/touch-sensor",
"libs/ultrasonic-sensor",
"libs/infrared-sensor",
"libs/gyro-sensor",
"libs/ev3"
],
"simulator": {