From 7e01d18bca190c0c701927b29688c3f380c5d538 Mon Sep 17 00:00:00 2001 From: CleoQc Date: Thu, 25 Oct 2018 14:09:29 -0400 Subject: [PATCH 01/17] avoid light --- gigglebot.ts | 39 +++++++++++++++++++++++++++++---------- pxt.json | 2 +- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/gigglebot.ts b/gigglebot.ts index 46f578e..2927b86 100644 --- a/gigglebot.ts +++ b/gigglebot.ts @@ -487,7 +487,7 @@ namespace gigglebot { /////////// LIGHT SENSOR BLOCKS /////////////////////////////////////////////////////////////////////// /** - * Will follow a spotlight shone on its eyes. If the spotlight disappears the gigglebot will stop. + * Will follow a spotlight shone on its eyes. */ //% blockId="gigglebot_follow_light" block="follow light" //% group=LightSensors @@ -509,6 +509,29 @@ namespace gigglebot { basic.pause(100) } + /** + * Will avoid a spotlight shone on its eyes. + */ + //% blockId="gigglebot_follow_light" block="avoid light" + //% group=LightSensors + //% weight=40 + export function lightAvoid() { + let diff = 20 + let current_lights = gigglebot.lightSensorsRaw() + if (current_lights[0] < 10 && current_lights[1] < 10) { + } + else if (current_lights[0] > current_lights[1] + diff) { + // it's brighter to the right + gigglebot.turn(gigglebotWhichTurnDirection.Left) + } else if (current_lights[1] > current_lights[0] + diff) { + // it's brighter to the left + gigglebot.turn(gigglebotWhichTurnDirection.Right) + } else { + gigglebot.driveStraight(gigglebotWhichDriveDirection.Forward) + } + basic.pause(100) + } + /** * Reads left or right light sensor. @@ -582,19 +605,11 @@ namespace gigglebot { return distanceSensor.readRangeSingleMillimeters() } - - - - /////////////////////////////////////////////////////////////////////// - /////////// MORE BLOCKS - /////////////////////////////////////////////////////////////////////// - - /////////// SERVO BLOCKS //% blockId="gigglebot_servo" block="set %which|servo to |%degree" //% group=Servo - //% degree.min=5 degree.max=175 + //% degree.min=0 degree.max=180 export function servoMove(which: gigglebotServoAction, degree: number) { if (which == gigglebotServoAction.Right) { pins.servoWritePin(AnalogPin.P13, degree) @@ -612,6 +627,10 @@ namespace gigglebot { } } + /////////////////////////////////////////////////////////////////////// + /////////// MORE BLOCKS + /////////////////////////////////////////////////////////////////////// + /** * This allows the user to correct the motors on the Gigglebot if it's not driving straight diff --git a/pxt.json b/pxt.json index 47ef9d3..0e175ce 100644 --- a/pxt.json +++ b/pxt.json @@ -1,6 +1,6 @@ { "name": "gigglebot", - "version": "1.0.6", + "version": "1.1.0", "dependencies": { "core": "*", "distanceSensor": "github:dexterind/pxt-distancesensor#v0.0.1" From dec876c2b9bb2f6c6199c6c615011bbbda6d8045 Mon Sep 17 00:00:00 2001 From: CleoQc Date: Thu, 29 Nov 2018 20:55:02 -0500 Subject: [PATCH 02/17] Line Follower now plays nice with the scheduler --- gigglebot.ts | 61 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/gigglebot.ts b/gigglebot.ts index 46f578e..d3018f2 100644 --- a/gigglebot.ts +++ b/gigglebot.ts @@ -107,7 +107,7 @@ enum gigglebotInequality { //% weight=99 color=#46BFB1 icon="\uf0d1" -//% groups='["other", "LineFollower", "LightSensors", "Servo", "DistanceSensor","OnBoardSensors", "Voltage", "Firmware"]' +//% groups='["other", "LineFollower", "LightSensors", "Servo", "DistanceSensor", "LightColorSensor", "OnBoardSensors", "Voltage", "Firmware"]' namespace gigglebot { /** * Basic drive and sensor functionalities for GiggleBot @@ -122,6 +122,7 @@ namespace gigglebot { let motorPowerLeft = currentMotorPower let motorPowerRight = currentMotorPower let distanceSensorInitDone = false; + let line_follow_in_action = false; let lineSensors = [0, 0] let lightSensors = [0, 0] // turn motor power off @@ -167,7 +168,7 @@ namespace gigglebot { export function followThinLine() { let all_black = false driveStraight(gigglebotWhichDriveDirection.Forward) - while (!(all_black)) { + while (!(all_black) && line_follow_in_action) { lineSensors = lineSensorsRaw() if (lineTest(gigglebotLineColor.Black)) { // We're done @@ -189,6 +190,7 @@ namespace gigglebot { // this should never happen } } + stop() } /** @@ -198,7 +200,7 @@ namespace gigglebot { function followThickLine() { let all_white = false driveStraight(gigglebotWhichDriveDirection.Forward) - while (!(all_white)) { + while (!(all_white) && line_follow_in_action) { lineSensors = lineSensorsRaw() if (lineTest(gigglebotLineColor.White)) { all_white = true @@ -217,9 +219,12 @@ namespace gigglebot { /* motorPowerAssign(gigglebotWhichMotor.Right, motorPowerRight + 5) */ } else { } + basic.pause(20) } + stop() } + /** * Configures the Distance Sensor. * must be called before doing any distance sensor readings. @@ -435,20 +440,34 @@ namespace gigglebot { /** * A thin black line would fall between the two sensors. The gigglebot will stop when both sensors are reading black. * A thick black line would have the two sensors on top of it at all times. The gigglebot will stop when both sensors are reading white. + * Calling this block puts the GiggleBot into "Line Follower Mode". To exit "Line Follower Mode" you need to call the "stop following line" block. * @param type_of_line thin line or thick line */ //% group=LineFollower //% blockId="gigglebot_follow_line" block="follow a %type_of_line| black line" //% weight=50 export function lineFollow(type_of_line: gigglebotLineType) { - if (type_of_line == gigglebotLineType.Thin) { - followThinLine() - } - else { - followThickLine() - } + line_follow_in_action = true + control.inBackground( () => { + if (type_of_line == gigglebotLineType.Thin) { + followThinLine() + } + else { + followThickLine() + } + }) } + /** + * Interrupt the line following mode and return control to regular blocks. + */ + //% group=LineFollower + //% blockId="gigglebot_stop_follow_line" block="stop following line" + //% weight= 49 + export function lineFollowStop() { + line_follow_in_action = false + gigglebot.stop() + } /** * Will return true if the whole line sensor is reading either black or white. @@ -526,7 +545,7 @@ namespace gigglebot { //////////////////////////////////////////////////////////////////////// /////////// DISTANCE SENSOR - /////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////// /** * Get a reading of how far an obstacle is from the distanse sensor. @@ -582,7 +601,29 @@ namespace gigglebot { return distanceSensor.readRangeSingleMillimeters() } + //////////////////////////////////////////////////////////////////////// + /////////// LIGHT COLOR SENSOR + //////////////////////////////////////////////////////////////////////// + //% block + //% group=LightColorSensor + export function lightColorSensorReadColorRed(): number { + let color = LightColorSensor.LCS_get_raw_data(true) + serial.writeNumber(color[0]) + return color[0] + } + //% block + //% group=LightColorSensor + export function lightColorSensorReadColorGreen(): number { + let color = LightColorSensor.LCS_get_raw_data() + return color[1] + } + //% block + //% group=LightColorSensor + export function lightColorSensorReadColorBlue(): number { + let color = LightColorSensor.LCS_get_raw_data() + return color[2] + } /////////////////////////////////////////////////////////////////////// From 098c4c5737a9f48935df1e61a959303954c6cc3c Mon Sep 17 00:00:00 2001 From: CleoQc Date: Thu, 29 Nov 2018 21:04:13 -0500 Subject: [PATCH 03/17] bump to 1.1.0 --- pxt.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pxt.json b/pxt.json index 47ef9d3..0e175ce 100644 --- a/pxt.json +++ b/pxt.json @@ -1,6 +1,6 @@ { "name": "gigglebot", - "version": "1.0.6", + "version": "1.1.0", "dependencies": { "core": "*", "distanceSensor": "github:dexterind/pxt-distancesensor#v0.0.1" From fc847d55b4ee01b6193a75167816120dfb402bf1 Mon Sep 17 00:00:00 2001 From: CleoQc Date: Mon, 3 Dec 2018 16:48:30 -0500 Subject: [PATCH 04/17] Get light follower in sync with line followr --- gigglebot.ts | 128 +++++++++++++++++++++++++++++---------------------- 1 file changed, 74 insertions(+), 54 deletions(-) diff --git a/gigglebot.ts b/gigglebot.ts index ca5f9c5..23ecaa0 100644 --- a/gigglebot.ts +++ b/gigglebot.ts @@ -100,6 +100,13 @@ enum gigglebotInequality { Farther } +enum gigglebotLightFollowMode { + //% block="follow" + Follow, + //% block="avoid" + Avoid +} + /** * Custom blocks */ @@ -107,7 +114,7 @@ enum gigglebotInequality { //% weight=99 color=#46BFB1 icon="\uf0d1" -//% groups='["other", "LineFollower", "LightSensors", "Servo", "DistanceSensor", "LightColorSensor", "OnBoardSensors", "Voltage", "Firmware"]' +//% groups='["other", "LineFollower", "LightSensors", "Servo", "DistanceSensor", "OnBoardSensors", "Voltage", "Firmware"]' namespace gigglebot { /** * Basic drive and sensor functionalities for GiggleBot @@ -123,6 +130,7 @@ namespace gigglebot { let motorPowerRight = currentMotorPower let distanceSensorInitDone = false; let line_follow_in_action = false; + let light_follow_in_action = false; let lineSensors = [0, 0] let lightSensors = [0, 0] // turn motor power off @@ -174,20 +182,16 @@ namespace gigglebot { // We're done all_black = true stop() - } else if (gigglebot.lineTest(gigglebotLineColor.White)) { + } else if (lineTest(gigglebotLineColor.White)) { // Line is between the two sensors, hopefully driveStraight(gigglebotWhichDriveDirection.Forward) } else if (lineSensors[0] < line_follower_threshold) { - // black is detected on left sensor only, therefore white on rightx sensor + // black is detected on left sensor only, therefore white on right sensor // correct towards the right - stop() motorPowerAssign(gigglebotWhichMotor.Left, motorPowerLeft + 5) } else if (lineSensors[1] < line_follower_threshold) { // correct towards the let - stop() motorPowerAssign(gigglebotWhichMotor.Right, motorPowerRight + 5) - } else { - // this should never happen } } stop() @@ -209,15 +213,10 @@ namespace gigglebot { driveStraight(gigglebotWhichDriveDirection.Forward) } else if (lineSensors[0] < line_follower_threshold) { /* left sensor reads black, right sensor reads white */ - stop() - /* motorPowerAssign(gigglebotWhichMotor.Left, motorPowerLeft + 5) */ turn(gigglebotWhichTurnDirection.Right) } else if (lineSensors[1] < line_follower_threshold) { /* right sensor reads black, left sensor reads white */ - stop() turn(gigglebotWhichTurnDirection.Left) - /* motorPowerAssign(gigglebotWhichMotor.Right, motorPowerRight + 5) */ - } else { } basic.pause(20) } @@ -388,6 +387,8 @@ namespace gigglebot { //% weight=70 export function stop() { motorPowerAssign(gigglebotWhichMotor.Both, 0) + light_follow_in_action = false + line_follow_in_action = false } /** @@ -459,14 +460,14 @@ namespace gigglebot { } /** - * Interrupt the line following mode and return control to regular blocks. + * True if robot is currently following a line. + * False otherwise */ //% group=LineFollower - //% blockId="gigglebot_stop_follow_line" block="stop following line" - //% weight= 49 - export function lineFollowStop() { - line_follow_in_action = false - gigglebot.stop() + //% blockId="gigglebot_follow_line_status" block="following line" + //% weight= 47 + export function lineFollowStatus() : boolean { + return (line_follow_in_action) } /** @@ -507,51 +508,70 @@ namespace gigglebot { /////////////////////////////////////////////////////////////////////// /** * Will follow a spotlight shone on its eyes. + * @param mode either follow or avoid light + * @param sensitivity how much of a difference between the two sides is needed for Gigglebot to react; eg: 20 */ - //% blockId="gigglebot_follow_light" block="follow light" + //% blockId="gigglebot_follow_light" block="react and %1 light" //% group=LightSensors - //% weight=40 - export function lightFollow() { - let diff = 20 - let current_lights = gigglebot.lightSensorsRaw() - if (current_lights[0] < 10 && current_lights[1] < 10) { - } - else if (current_lights[0] > current_lights[1] + diff) { - // it's brighter to the right - gigglebot.turn(gigglebotWhichTurnDirection.Right) - } else if (current_lights[1] > current_lights[0] + diff) { - // it's brighter to the left - gigglebot.turn(gigglebotWhichTurnDirection.Left) - } else { - gigglebot.driveStraight(gigglebotWhichDriveDirection.Forward) - } - basic.pause(100) + //% weight=99 + export function lightFollow(mode: gigglebotLightFollowMode, sensitivity: number = 20) { + light_follow_in_action = true + let giveup_count = 0; + control.inBackground( () => { + while ( light_follow_in_action && giveup_count < 5) + { + lightSensors = lightSensorsRaw() + serial.writeNumbers(lightSensors) + serial.writeLine("") + + if (lightSensors[0] > lightSensors[1] + sensitivity) { + // it's brighter to the right + serial.writeString("Brighter to the right") + if (mode == gigglebotLightFollowMode.Follow){ + turn(gigglebotWhichTurnDirection.Right) + } else { + turn(gigglebotWhichTurnDirection.Left) + } + } else if (lightSensors[1] > lightSensors[0] + sensitivity) { + // it's brighter to the left + serial.writeString("Brighter to the left") + if (mode == gigglebotLightFollowMode.Follow){ + turn(gigglebotWhichTurnDirection.Left) + } else { + turn(gigglebotWhichTurnDirection.Right) + } + } else { + serial.writeString("Go Straight") + driveStraight(gigglebotWhichDriveDirection.Forward) + } + + basic.pause(20); + + if (mode == gigglebotLightFollowMode.Follow && lightSensors[0] < sensitivity && lightSensors[1] < sensitivity) + { + giveup_count = giveup_count + 1 + } + if (mode == gigglebotLightFollowMode.Avoid && lightSensors[0] > 1000 - sensitivity && lightSensors[1] > 1000 - sensitivity) + { + giveup_count = giveup_count + 1 + } + } + serial.writeString("STOP") + stop() + }) } /** - * Will avoid a spotlight shone on its eyes. + * True if robot is currently reacting to light. + * False otherwise */ - //% blockId="gigglebot_follow_light" block="avoid light" //% group=LightSensors - //% weight=40 - export function lightAvoid() { - let diff = 20 - let current_lights = gigglebot.lightSensorsRaw() - if (current_lights[0] < 10 && current_lights[1] < 10) { - } - else if (current_lights[0] > current_lights[1] + diff) { - // it's brighter to the right - gigglebot.turn(gigglebotWhichTurnDirection.Left) - } else if (current_lights[1] > current_lights[0] + diff) { - // it's brighter to the left - gigglebot.turn(gigglebotWhichTurnDirection.Right) - } else { - gigglebot.driveStraight(gigglebotWhichDriveDirection.Forward) - } - basic.pause(100) + //% blockId="gigglebot_react_light_status" block="reacting to light" + //% weight= 47 + export function lightFollowStatus() : boolean { + return (light_follow_in_action) } - /** * Reads left or right light sensor. * The light sensors are placed in front of each eye neopixel, they're tiny! From 94dd420823cce42578601c10bcf548deae0af5ce Mon Sep 17 00:00:00 2001 From: CleoQc Date: Fri, 7 Dec 2018 11:34:19 -0500 Subject: [PATCH 05/17] Protect background loops from being called many times. --- gigglebot.ts | 110 ++++++++++++++++++++++++++------------------------- 1 file changed, 56 insertions(+), 54 deletions(-) diff --git a/gigglebot.ts b/gigglebot.ts index 23ecaa0..214b9fb 100644 --- a/gigglebot.ts +++ b/gigglebot.ts @@ -443,20 +443,26 @@ namespace gigglebot { * A thick black line would have the two sensors on top of it at all times. The gigglebot will stop when both sensors are reading white. * Calling this block puts the GiggleBot into "Line Follower Mode". To exit "Line Follower Mode" you need to call the "stop following line" block. * @param type_of_line thin line or thick line + * @param specific_line_threshold overwrite the default line threshold to adapt to your particular tape and lighting condition. */ //% group=LineFollower //% blockId="gigglebot_follow_line" block="follow a %type_of_line| black line" //% weight=50 - export function lineFollow(type_of_line: gigglebotLineType) { - line_follow_in_action = true - control.inBackground( () => { - if (type_of_line == gigglebotLineType.Thin) { - followThinLine() - } - else { - followThickLine() - } - }) + export function lineFollow(type_of_line: gigglebotLineType, specific_line_threshold: number = 175) { + // test if the line follower is already in action in case this was put + // in a loop. Only launch one in background + if (!line_follow_in_action) { + line_follow_in_action = true + line_follower_threshold = specific_line_threshold + control.inBackground( () => { + if (type_of_line == gigglebotLineType.Thin) { + followThinLine() + } + else { + followThickLine() + } + }) + } } /** @@ -511,62 +517,58 @@ namespace gigglebot { * @param mode either follow or avoid light * @param sensitivity how much of a difference between the two sides is needed for Gigglebot to react; eg: 20 */ - //% blockId="gigglebot_follow_light" block="react and %1 light" + //% blockId="gigglebot_follow_light" block="follow light" //% group=LightSensors //% weight=99 - export function lightFollow(mode: gigglebotLightFollowMode, sensitivity: number = 20) { - light_follow_in_action = true - let giveup_count = 0; - control.inBackground( () => { - while ( light_follow_in_action && giveup_count < 5) - { - lightSensors = lightSensorsRaw() - serial.writeNumbers(lightSensors) - serial.writeLine("") - - if (lightSensors[0] > lightSensors[1] + sensitivity) { - // it's brighter to the right - serial.writeString("Brighter to the right") - if (mode == gigglebotLightFollowMode.Follow){ - turn(gigglebotWhichTurnDirection.Right) - } else { - turn(gigglebotWhichTurnDirection.Left) - } - } else if (lightSensors[1] > lightSensors[0] + sensitivity) { - // it's brighter to the left - serial.writeString("Brighter to the left") - if (mode == gigglebotLightFollowMode.Follow){ - turn(gigglebotWhichTurnDirection.Left) + export function lightFollow(mode: gigglebotLightFollowMode = gigglebotLightFollowMode.Follow, sensitivity: number = 20) { + // test if the light follower is already in action in case this was put + // in a loop. Only launch one in background + if ( ! light_follow_in_action) { + light_follow_in_action = true + let giveup_count = 0; + control.inBackground( () => { + while ( light_follow_in_action && giveup_count < 5) { + lightSensors = lightSensorsRaw() + + if (lightSensors[0] > lightSensors[1] + sensitivity) { + // it's brighter to the right + if (mode == gigglebotLightFollowMode.Follow){ + turn(gigglebotWhichTurnDirection.Right) + } else { + turn(gigglebotWhichTurnDirection.Left) + } + } else if (lightSensors[1] > lightSensors[0] + sensitivity) { + // it's brighter to the left + if (mode == gigglebotLightFollowMode.Follow){ + turn(gigglebotWhichTurnDirection.Left) + } else { + turn(gigglebotWhichTurnDirection.Right) + } } else { - turn(gigglebotWhichTurnDirection.Right) + driveStraight(gigglebotWhichDriveDirection.Forward) } - } else { - serial.writeString("Go Straight") - driveStraight(gigglebotWhichDriveDirection.Forward) - } - basic.pause(20); + if (mode == gigglebotLightFollowMode.Follow && lightSensors[0] < sensitivity && lightSensors[1] < sensitivity) { + giveup_count = giveup_count + 1 + } + if (mode == gigglebotLightFollowMode.Avoid && lightSensors[0] > 1000 - sensitivity && lightSensors[1] > 1000 - sensitivity) { + giveup_count = giveup_count + 1 + } - if (mode == gigglebotLightFollowMode.Follow && lightSensors[0] < sensitivity && lightSensors[1] < sensitivity) - { - giveup_count = giveup_count + 1 + // Play well with others + basic.pause(20); } - if (mode == gigglebotLightFollowMode.Avoid && lightSensors[0] > 1000 - sensitivity && lightSensors[1] > 1000 - sensitivity) - { - giveup_count = giveup_count + 1 - } - } - serial.writeString("STOP") - stop() - }) + stop() + }) + } } /** - * True if robot is currently reacting to light. + * True if robot is currently following light. * False otherwise */ //% group=LightSensors - //% blockId="gigglebot_react_light_status" block="reacting to light" + //% blockId="gigglebot_follow_light_status" block="following light" //% weight= 47 export function lightFollowStatus() : boolean { return (light_follow_in_action) @@ -823,5 +825,5 @@ namespace gigglebot { } // serial.writeNumbers(light_sensor) return lightSensors -} + } } From 6ee1fb15e7cd8ed6fa789f487459d97a25245118 Mon Sep 17 00:00:00 2001 From: CleoQc Date: Fri, 7 Dec 2018 11:59:18 -0500 Subject: [PATCH 06/17] light_threshold to exit light following loop --- gigglebot.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gigglebot.ts b/gigglebot.ts index 214b9fb..786475c 100644 --- a/gigglebot.ts +++ b/gigglebot.ts @@ -516,11 +516,12 @@ namespace gigglebot { * Will follow a spotlight shone on its eyes. * @param mode either follow or avoid light * @param sensitivity how much of a difference between the two sides is needed for Gigglebot to react; eg: 20 + * @param light_threshold how much light is needed to consider the loop needs to end. This can happen when a light following robot is covered with a box; eg: 10 */ //% blockId="gigglebot_follow_light" block="follow light" //% group=LightSensors //% weight=99 - export function lightFollow(mode: gigglebotLightFollowMode = gigglebotLightFollowMode.Follow, sensitivity: number = 20) { + export function lightFollow(mode: gigglebotLightFollowMode = gigglebotLightFollowMode.Follow, sensitivity: number = 20, light_threshold: number = 10) { // test if the light follower is already in action in case this was put // in a loop. Only launch one in background if ( ! light_follow_in_action) { @@ -529,7 +530,6 @@ namespace gigglebot { control.inBackground( () => { while ( light_follow_in_action && giveup_count < 5) { lightSensors = lightSensorsRaw() - if (lightSensors[0] > lightSensors[1] + sensitivity) { // it's brighter to the right if (mode == gigglebotLightFollowMode.Follow){ @@ -547,16 +547,17 @@ namespace gigglebot { } else { driveStraight(gigglebotWhichDriveDirection.Forward) } - - if (mode == gigglebotLightFollowMode.Follow && lightSensors[0] < sensitivity && lightSensors[1] < sensitivity) { + if (mode == gigglebotLightFollowMode.Follow && lightSensors[0] < light_threshold && lightSensors[1] < light_threshold) { giveup_count = giveup_count + 1 } - if (mode == gigglebotLightFollowMode.Avoid && lightSensors[0] > 1000 - sensitivity && lightSensors[1] > 1000 - sensitivity) { + if (mode == gigglebotLightFollowMode.Avoid && lightSensors[0] > 1000 - light_threshold && lightSensors[1] > 1000 - light_threshold) { giveup_count = giveup_count + 1 } - - // Play well with others + + // play nice with others basic.pause(20); + + } stop() }) From 8ae8208cd614bf52f6aa09183b0501ac05cb1a86 Mon Sep 17 00:00:00 2001 From: CleoQc Date: Fri, 7 Dec 2018 11:59:36 -0500 Subject: [PATCH 07/17] Updated readme --- README.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cf423d4..98e0242 100644 --- a/README.md +++ b/README.md @@ -70,15 +70,17 @@ gigglebot.setSpeed(gigglebotWhichMotor.Both, gigglebotWhichSpeed.Slowest) ``` ### Following a line #linefollow -The GiggleBot comes with two line sensors that allows it to follow either a thick line or a thin line. The thick line is thick enough that both sensors will attempt to be over the line , while the thin line is thin enough to fit between the two sensors,and each sensor will attempt to avoid the line. +The GiggleBot comes with two line sensors that allows it to follow either a thick line or a thin line. The thick line is thick enough that both sensors will attempt to be over the line, while the thin line is thin enough to fit between the two sensors and each sensor will attempt to avoid the line. ```blocks -gigglebot.lineFollow(gigglebotLineType.Thick) +input.onButtonPressed(Button.A, function () { + gigglebot.lineFollow(gigglebotLineType.Thick) +}) ``` ### Reading the line sensors #linereadsensor -You can also access the line sensors values directly. This allows you to write a line follower logic that is tailored to your specific needs. +You can also access the line sensors values directly by using the blocks under the "more..." section. This allows you to write a line follower logic that is tailored to your specific needs. ```blocks basic.showNumber(gigglebot.lineReadSensor(gigglebotWhichTurnDirection.Right)) @@ -97,19 +99,20 @@ basic.forever(() => { ### Following a light #lightfollow -The GiggleBot comes with two light sensors that allows it to follow a spotlight, a little bit like a cat would. Shining a flashlight onto one eye will get the GiggleBot to turn in that direction. You need to put this block in a loop. You may use a forever loop or one where you control the end condition. Make sure you stop the robot when exiting the loop! +The GiggleBot comes with two light sensors that allows it to follow a spotlight, a little bit like a cat would. Shining a flashlight onto one eye will get the GiggleBot to turn in that direction. The robot will go straight if the two sides receive similar lighting conditions. ```blocks -input.onButtonPressed(Button.A, () => { - while (!(input.buttonIsPressed(Button.B))) { - gigglebot.lightFollow() - } +input.onButtonPressed(Button.A, function () { + gigglebot.lightFollow() +}) +input.onButtonPressed(Button.B, function () { gigglebot.stop() }) + ``` ### Reading the light sensor values #lightreadsensor -You can also read the light sensors values directly in order to implement a different behaviour, like having the GiggleBot fall asleep when it gets dark, and wake up when there's light. +You can also read the light sensors values directly in order to implement a different behaviour, like having the GiggleBot fall asleep when it gets dark, and wake up when there's light. The light sensor reading block can be found under the "more..." section. ```blocks basic.forever(() => { From 9c14dfd7db149857b7bd3b98a58100ce1964865d Mon Sep 17 00:00:00 2001 From: CleoQc Date: Fri, 7 Dec 2018 19:45:46 -0500 Subject: [PATCH 08/17] Merge Follow Thin/Thick lines. Follow Line and Light mutually exclusive --- gigglebot.ts | 70 ++++++++++++++++++++-------------------------------- 1 file changed, 27 insertions(+), 43 deletions(-) diff --git a/gigglebot.ts b/gigglebot.ts index 786475c..cae2245 100644 --- a/gigglebot.ts +++ b/gigglebot.ts @@ -169,39 +169,11 @@ namespace gigglebot { motorPowerRight = rightpower } - /** - * This code allows the Gigglebot to follow a line thin enough to fall between the two sensors. - * The robot will stop when both of its sensors will detect black. - */ - export function followThinLine() { - let all_black = false - driveStraight(gigglebotWhichDriveDirection.Forward) - while (!(all_black) && line_follow_in_action) { - lineSensors = lineSensorsRaw() - if (lineTest(gigglebotLineColor.Black)) { - // We're done - all_black = true - stop() - } else if (lineTest(gigglebotLineColor.White)) { - // Line is between the two sensors, hopefully - driveStraight(gigglebotWhichDriveDirection.Forward) - } else if (lineSensors[0] < line_follower_threshold) { - // black is detected on left sensor only, therefore white on right sensor - // correct towards the right - motorPowerAssign(gigglebotWhichMotor.Left, motorPowerLeft + 5) - } else if (lineSensors[1] < line_follower_threshold) { - // correct towards the let - motorPowerAssign(gigglebotWhichMotor.Right, motorPowerRight + 5) - } - } - stop() - } - /** * Follows a line that is thicker than the space between the two sensors * The robot will stop when both of its sensors will detect white */ - function followThickLine() { + function followLine(type_of_line: gigglebotLineType) { let all_white = false driveStraight(gigglebotWhichDriveDirection.Forward) while (!(all_white) && line_follow_in_action) { @@ -213,15 +185,24 @@ namespace gigglebot { driveStraight(gigglebotWhichDriveDirection.Forward) } else if (lineSensors[0] < line_follower_threshold) { /* left sensor reads black, right sensor reads white */ - turn(gigglebotWhichTurnDirection.Right) + if (type_of_line == gigglebotLineType.Thick){ + turn(gigglebotWhichTurnDirection.Right) + } else { + turn(gigglebotWhichTurnDirection.Left) + } } else if (lineSensors[1] < line_follower_threshold) { /* right sensor reads black, left sensor reads white */ - turn(gigglebotWhichTurnDirection.Left) + if (type_of_line == gigglebotLineType.Thick){ + turn(gigglebotWhichTurnDirection.Left) + } else { + turn(gigglebotWhichTurnDirection.Right) + } } + + // play well with others basic.pause(20) } - stop() - } + } /** @@ -453,13 +434,12 @@ namespace gigglebot { // in a loop. Only launch one in background if (!line_follow_in_action) { line_follow_in_action = true + light_follow_in_action = false // mutually exclusive line_follower_threshold = specific_line_threshold control.inBackground( () => { - if (type_of_line == gigglebotLineType.Thin) { - followThinLine() - } - else { - followThickLine() + followLine(type_of_line) + if (line_follow_in_action){ + stop() } }) } @@ -526,6 +506,7 @@ namespace gigglebot { // in a loop. Only launch one in background if ( ! light_follow_in_action) { light_follow_in_action = true + line_follow_in_action = false // mutually exclusive let giveup_count = 0; control.inBackground( () => { while ( light_follow_in_action && giveup_count < 5) { @@ -547,19 +528,22 @@ namespace gigglebot { } else { driveStraight(gigglebotWhichDriveDirection.Forward) } + if (mode == gigglebotLightFollowMode.Follow && lightSensors[0] < light_threshold && lightSensors[1] < light_threshold) { giveup_count = giveup_count + 1 } if (mode == gigglebotLightFollowMode.Avoid && lightSensors[0] > 1000 - light_threshold && lightSensors[1] > 1000 - light_threshold) { giveup_count = giveup_count + 1 } - - // play nice with others - basic.pause(20); - + // play well with others + basic.pause(20); + } + // If we're still in light following mode, then stop + // It's possible that stop() was called elsewhere + if (light_follow_in_action){ + stop() } - stop() }) } } From 01d0d8333a75dd09b490dbd536b43b028fc5d7f1 Mon Sep 17 00:00:00 2001 From: CleoQc Date: Fri, 7 Dec 2018 19:49:57 -0500 Subject: [PATCH 09/17] Formatting --- gigglebot.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gigglebot.ts b/gigglebot.ts index cae2245..8426d39 100644 --- a/gigglebot.ts +++ b/gigglebot.ts @@ -501,7 +501,9 @@ namespace gigglebot { //% blockId="gigglebot_follow_light" block="follow light" //% group=LightSensors //% weight=99 - export function lightFollow(mode: gigglebotLightFollowMode = gigglebotLightFollowMode.Follow, sensitivity: number = 20, light_threshold: number = 10) { + export function lightFollow(mode: gigglebotLightFollowMode = gigglebotLightFollowMode.Follow, + sensitivity: number = 20, + light_threshold: number = 10) { // test if the light follower is already in action in case this was put // in a loop. Only launch one in background if ( ! light_follow_in_action) { @@ -529,12 +531,20 @@ namespace gigglebot { driveStraight(gigglebotWhichDriveDirection.Forward) } - if (mode == gigglebotLightFollowMode.Follow && lightSensors[0] < light_threshold && lightSensors[1] < light_threshold) { + if (mode == gigglebotLightFollowMode.Follow && + lightSensors[0] < light_threshold && + lightSensors[1] < light_threshold) { giveup_count = giveup_count + 1 } - if (mode == gigglebotLightFollowMode.Avoid && lightSensors[0] > 1000 - light_threshold && lightSensors[1] > 1000 - light_threshold) { + else if (mode == gigglebotLightFollowMode.Avoid && + lightSensors[0] > 1000 - light_threshold && + lightSensors[1] > 1000 - light_threshold) { giveup_count = giveup_count + 1 } + else { + // must have consecutive readings before giving up + giveup_count = 0 + } // play well with others basic.pause(20); From 693603226f97c3b537cdd5d8ef1f4cc006a5b45f Mon Sep 17 00:00:00 2001 From: CleoQc Date: Sat, 8 Dec 2018 15:28:26 -0500 Subject: [PATCH 10/17] translating strings --- _locales/fr/gigglebot-jsdoc-strings.json | 106 ++++++++++--------- _locales/fr/gigglebot-strings.json | 126 ++++++++++++----------- _locales/gigglebot-jsdoc-strings.json | 108 ++++++++++--------- _locales/gigglebot-strings.json | 126 ++++++++++++----------- 4 files changed, 245 insertions(+), 221 deletions(-) diff --git a/_locales/fr/gigglebot-jsdoc-strings.json b/_locales/fr/gigglebot-jsdoc-strings.json index 92cff12..6689559 100644 --- a/_locales/fr/gigglebot-jsdoc-strings.json +++ b/_locales/fr/gigglebot-jsdoc-strings.json @@ -1,52 +1,58 @@ { - "gigglebot": "Custom blocks", - "gigglebot.distanceSensorReadRangeContinuous": "Get a reading of how far an obstacle is from the distanse sensor.", - "gigglebot.distanceSensorReadRangeSingle": "Distance Sensor: takes a single reading.", - "gigglebot.distanceSensorTestForObstacle": "Test for the presence of an obstacle.", - "gigglebot.distanceSensorTestForObstacle|param|dist": "how many millimeters; eg: 100", - "gigglebot.distanceSensorTestForObstacle|param|inequality": "less than or more than, closer than or farther than", - "gigglebot.driveMillisec": "Will let gigglebot move forward or backward for a number of milliseconds.\nDistance covered during that time is related to the freshness of the batteries.", - "gigglebot.driveMillisec|param|delay": "for how many milliseconds; eg: 1000", - "gigglebot.driveMillisec|param|dir": "forward or backward; ", - "gigglebot.driveStraight": "Will let gigglebot move forward or backward until told otherwise (either by a stop block or a turn block).", - "gigglebot.driveStraight|param|dir": "forward or backward", - "gigglebot.followThinLine": "This code allows the Gigglebot to follow a line thin enough to fall between the two sensors. \nThe robot will stop when both of its sensors will detect black.", - "gigglebot.gigglebotSpin": "Gigglebot will spin on itself until told otherwise, like a turn but staying in the same spot. Especially useful when drawing.", - "gigglebot.gigglebotSpinMillisec": "Gigglebot will spin on itself for the provided number of milliseconds, like a turn but staying in the same spot. Especially useful when drawing", - "gigglebot.gigglebotSpinMillisec|param|delay": "how many milliseconds; eg: 1000", - "gigglebot.gigglebotSpinMillisec|param|turn_dir": "turning left or right", - "gigglebot.gigglebotSpin|param|turn_dir": "left or right;", - "gigglebot.leftPower": "return current power setting of the left motor", - "gigglebot.lightFollow": "Will follow a spotlight shone on its eyes. If the spotlight disappears the gigglebot will stop.", - "gigglebot.lightReadSensor": "Reads left or right light sensor. \nThe light sensors are placed in front of each eye neopixel, they're tiny! \nThe range is 0 through 1023, although in reality rarely above ~950.", - "gigglebot.lightReadSensor|param|which": "left or right", - "gigglebot.lineFollow": "A thin black line would fall between the two sensors. The gigglebot will stop when both sensors are reading black.\nA thick black line would have the two sensors on top of it at all times. The gigglebot will stop when both sensors are reading white.", - "gigglebot.lineFollow|param|type_of_line": "thin line or thick line", - "gigglebot.lineReadSensor": "Reads left or right line sensor", - "gigglebot.lineReadSensor|param|which": "left or right", - "gigglebot.lineSensorsRaw": "Reads the two line sensors", - "gigglebot.lineTest": "Will return true if the whole line sensor is reading either black or white.\n@param color: black or white", - "gigglebot.motorPowerAssign": "Assigns power to a motor, or the same power to both motors\nValues from 101 through 127, and -128 through -101 are used to float the motor.\n@param motor: left or right motor, or both\n@param power: a value between -100 and 100", - "gigglebot.motorPowerAssignBoth": "Assigns potentially different powers to both motors in one call. \nValues from 101 through 127, and -128 through -101 are used to float the motor.\n@param left_power: the power to assign to the left motor (between -100 and 100)\n@param right_power: the power to assign to the right motor (between -100 and 100)", - "gigglebot.motorTrimSet": "This allows the user to correct the motors on the Gigglebot if it's not driving straight\n@param dir: if the gigglebot drives to the left, then correct to the right. Vice versa. \n@param trim_value: a correction value between 0 and 100, but most likely below 10", - "gigglebot.rightPower": "return current power setting of the right motor", - "gigglebot.setLeftPower": "Assigns a new power value to the left motor\nValues from 101 through 127, and -128 through -101 are used to float the motor.", - "gigglebot.setLeftPower|param|leftpower": "new value for the power setting of the left motor (-100 < leftpower < 100)", - "gigglebot.setRightPower": "Assigns a new power value to the right motor\nValues from 101 through 127, and -128 through -101 are used to float the motor.", - "gigglebot.setRightPower|param|rightpower": "new value for the power setting of the right motor. (-100 < rightpower < 100)", - "gigglebot.setSpeed": "You can set the speed for each individual motor or both together. The higher the speed the less control the robot has.\nYou may need to correct the robot (see block in \"more...\" section). A faster robot needs more correction than a slower one.\nIf you want to follow a line, it will work best at a lower speed.\nActual speed is dependent on the freshness of the batteries.\n@param motor: left, right or both motors\n@param speed: how fast the robot goes.", - "gigglebot.steer": "Gigglebot will drive forward while steering to one side. \nUseful when it needs to go around an obstacle, or orbit around an object.\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", - "gigglebot.steerMillisec": "Gigglebot will drive forward while steering to one side for the provided number of milliseconds. \nUseful when it needs to go around an obstacle, or orbit around an object.\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", - "gigglebot.steerMillisec|param|delay": "for how many milliseconds; eg: 1000", - "gigglebot.steerMillisec|param|dir": "which direction to steer, left or right", - "gigglebot.steerMillisec|param|percent": "the variation in power between left and right; eg: 0, 20, 50, 100", - "gigglebot.steer|param|dir": "to the left or to the right", - "gigglebot.steer|param|percent": "value between 0 and 100 to control the amount of steering", - "gigglebot.stop": "stops the robot.", - "gigglebot.turn": "Will make gigglebot turn left or right until told otherwise (by a stop block or a drive block).", - "gigglebot.turnMillisec": "Will make gigglebot turn left and right for a number of milliseconds. How far it turns depends on the freshness of the batteries.", - "gigglebot.turnMillisec|param|delay": "for how many milliseconds; eg: 1000", - "gigglebot.turnMillisec|param|turn_dir": "turning left or right", - "gigglebot.voltageShow": "Displays the current battery voltage. Anything lower than 3.4 is too low to run the motors", - "gigglebotWhichUniqueMotor": "Use this file to define custom functions and blocks.\nRead more at https://makecode.microbit.org/blocks/custom" + "gigglebot": "blocs", + "gigglebot.distanceSensorReadRangeContinuous": "Prendre une lecture de la distance jusqu'à l'obstacle", + "gigglebot.distanceSensorReadRangeSingle": "Prendre une lecture simple de la distance", + "gigglebot.distanceSensorTestForObstacle": "Tester la présence d'un obstacle", + "gigglebot.distanceSensorTestForObstacle|param|dist": "combien de millimètres; eg: 100", + "gigglebot.distanceSensorTestForObstacle|param|inequality": "moins que ou plus que, plus proche que ou plus loin que", + "gigglebot.driveMillisec": "Le GiggleBot avancera ou reculera pendant un certain nombre de millisecondes\nLa distance parcourue pendant ce temps dépend de la puissance des batteries.", + "gigglebot.driveMillisec|param|delay": "pendant combien de millisecondes; eg: 1000", + "gigglebot.driveMillisec|param|dir": "avancer ou reculer", + "gigglebot.driveStraight": "Le GiggleBot avancera ou reculera jusqu'à ordre contraire (soit par un bloc Arrêt ou un autre bloc).", + "gigglebot.driveStraight|param|dir": "avancer ou reculer", + "gigglebot.gigglebotSpin": "Le GiggleBot pivotera sur lui-même jusqu'à ordre contraire, en restant sur place. Particulièrement utile pour dessiner.", + "gigglebot.gigglebotSpin|param|turn_dir": "vers la gauche ou vers la droite;", + "gigglebot.leftPower": "la puissance du moteur de gauche", + "gigglebot.lightFollow": "Le GiggleBot ira vers la lumière. Si le robot se retrouve dans le noir, il arrêtera.", + "gigglebot.lightFollowStatus": "Vrai si le robot est présentement en train de suivre une lumière.\r\nFaux autrement.", + "gigglebot.lightFollow|param|light_threshold": "la quantité de luminosité requise pour considérer que le GigleBot est dans le noir, par exemple s'il est emprisonné dans une boîte; eg: 10", + "gigglebot.lightFollow|param|mode": "suivre ou éviter la lumière", + "gigglebot.lightFollow|param|sensitivity": "la différence requise entre les deux capteurs de lumière pour faire tourner le GiggleBot; eg: 20", + "gigglebot.lightReadSensor": "Lire le capteur de lumière de gauche ou de droite. \nLes capteurs de lumière sont situés juste en avant des yeux, ils sont tout petits!\nLes valeurs vont de 0 à 1023, en réalité rarement plus que ~950.", + "gigglebot.lightReadSensor|param|which": "gauche ou droite", + "gigglebot.lineFollow": "Une ligne mince passera entre les deux capteurs et le GiggleBot arrêtera lorsque les deux capteurs détecteront du noir.\nUne large ligne noire sera plus large que la distance entre les deux capteurs. Le GiggleBot arrêtera lorsque les deux capteurs détecteront du blanc.", + "gigglebot.lineFollowStatus": "Vrai lorsque le robot suit une ligne.\r\nFalx autrement.", + "gigglebot.lineFollow|param|specific_line_threshold": "modifie la valeur par défaut du seuil de détection d'une ligne pour une meilleure adaptation à l'environnement du GiggleBot.", + "gigglebot.lineFollow|param|type_of_line": "ligne large ou mince.", + "gigglebot.lineReadSensor": "Lit le capteur de gauche ou de droite.", + "gigglebot.lineReadSensor|param|which": "gauche ou droite", + "gigglebot.lineSensorsRaw": "Lit les deux capteurs", + "gigglebot.lineTest": "Vrai si les deux capteurs détectent soit du noir, soit du blanc.\n@param color: noir ou blanc", + "gigglebot.motorPowerAssign": "Assigne une puissance à un moteur, ou la même puissance aux deux moteurs\nLes valeurs possibles vont de 101 à 127, et les valeurs de -128 à -101 sont utilisés pour laisser le moteur aller sur son élan.\n@param motor: moteur de gauche ou de droite, ou les deux\n@param power: une valeur entre -100 et 100", + "gigglebot.motorPowerAssignBoth": "Assigne de nouvelles puissances potentiellement différentes aux deux moteurs en un seul bloc. \nValues from 101 through 127, and -128 through -101 are used to float the motor.\n@param left_power: la puissance du moteur de gauche (entre -100 et 100)\n@param right_power: la puissance du moteur de droite (entre -100 et 100)", + "gigglebot.motorTrimSet": "Permet de corriger les moteurs lorsque le GiggleBot ne se déplace pas en ligne droite.\r\n@param dir: si le GiggleBot dévie vers la gauche, corriger vers la droite ou vice versa. \r\n@param trim_value: une valeur de correction entre 0 et 100, probablement en deça de 10", + "gigglebot.rightPower": "la valeur courante de la puissance du moteur de droite", + "gigglebot.setLeftPower": "Assigne une puissance au moteur de gauche\nLes valeurs possibles vont de 101 à 127, et les valeurs de -128 à -101 sont utilisés pour laisser le moteur aller sur son élan.\n@param motor: moteur de gauche ou de droite, ou les deux\n@param power: une valeur entre -100 et 100", + "gigglebot.setLeftPower|param|leftpower": "nouvelle valeur de la puissance du moteur de gauche (-100 < leftpower < 100). Les valeurs de 101 à 127 ou de -128 à -101 privent le moteur de sa puissance.", + "gigglebot.setLineFollowerThreshold": "Une méthode purement Javascript permettant de changer le seuil de réponse du détecteur de ligne.", + "gigglebot.setRightPower": "Assigne une puissance au moteur de droite\nLes valeurs possibles vont de 101 à 127, et les valeurs de -128 à -101 sont utilisés pour laisser le moteur aller sur son élan.\n@param motor: moteur de gauche ou de droite, ou les deux\n@param power: une valeur entre -100 et 100", + "gigglebot.setRightPower|param|rightpower": "nouvelle valeur de la puissance du moteur de droite (-100 < leftpower < 100). Les valeurs de 101 à 127 ou de -128 à -101 privent le moteur de sa puissance.", + "gigglebot.setSpeed": "Ajuster la vitesse de chacun des moteurs, ou les deux en même temps. Plus le GiggleBot va vite, moins il sera précis.\nIl est possible que les moteurs aient besoin d'être corrigés avec le bloc correspondant. Plus le GiggleBot est rapide plus il aura besoin de correction\nPour suivre une ligne il est préférable d'y aller à vitesse lente.\nLa vitesse dépend de la puissance des batteries.\n@param motor: gauche, droite, ou les deux\n@param speed: la vitesse du robot.", + "gigglebot.SpinMillisec": "Le Gigglebot pivotera sur place pendant X millisecondes, en restant sur place. Très pratique pour dessiner.", + "gigglebot.SpinMillisec|param|delay": "combien de millisecondes; eg: 1000", + "gigglebot.SpinMillisec|param|turn_dir": "tourner vers la gauche ou vers la droite", + "gigglebot.steer": "Le Gigglebot avancera en courbant vers la droite ou la gauche.\nUtile pour contourner un obstacle ou pour être en orbite autour d'un objet.\n0% indique aucune courbure et revient à avancer, 100% donne le même résultat que le bloc Tourner", + "gigglebot.steerMillisec": "Le Gigglebot avancera en courbant vers la droite ou la gauche pendant X milliseconded. \nUtile pour contourner un obstacle ou pour être en orbite autour d'un objet.\n0% indique aucune courbure et revient à avancer, 100% donne le même résultat que le bloc Tourner", + "gigglebot.steerMillisec|param|delay": "combien de millisecondes; eg: 1000", + "gigglebot.steerMillisec|param|dir": "courber vers la droite ou vers la gauche", + "gigglebot.steerMillisec|param|percent": "la différence de puissance entre le moteur gauche et le moteur droit; eg: 0, 20, 50, 100", + "gigglebot.steer|param|dir": "vers la droite ou vers la gauche", + "gigglebot.steer|param|percent": "une valeur entre 0 et 100 qui contrôle la courbe", + "gigglebot.stop": "Arrêter le robot.", + "gigglebot.turn": "Le GiggleBot tournera vers la gauche ou la droite tant qu'un autre bloc ne l'interrompe.", + "gigglebot.turnMillisec": "Le GiggleBot tournera vers la gauche ou la droite pendant X millisecondes.", + "gigglebot.turnMillisec|param|delay": "combien de millisecondes; eg: 1000", + "gigglebot.turnMillisec|param|turn_dir": "vers la gauche ou vers la droite", + "gigglebot.voltageShow": "Affiche le voltage des batteries. Moins que 3.4 indique des batteries trop faibles pour faire bouger le GiggleBot", + "gigglebotWhichUniqueMotor": "" } \ No newline at end of file diff --git a/_locales/fr/gigglebot-strings.json b/_locales/fr/gigglebot-strings.json index 7dd67a4..225ab10 100644 --- a/_locales/fr/gigglebot-strings.json +++ b/_locales/fr/gigglebot-strings.json @@ -1,61 +1,67 @@ { - "gigglebot.distanceSensorReadRangeContinuous|block": "distance jusqu'à l'obstacle (mm)", - "gigglebot.distanceSensorTestForObstacle|block": "obstacle se trouve %inequality| %dist| mm", - "gigglebot.driveMillisec|block": "%dir|pendant %delay|m", - "gigglebot.driveStraight|block": "%dir", - "gigglebot.firmwareVersion|block": "version du firmware", - "gigglebot.gigglebotSpinMillisec|block": "pivoter vers la %turn_dir|pendant %delay|ms", - "gigglebot.gigglebotSpin|block": "pivoter vers la %turn_dir", - "gigglebot.lightFollow|block": "suivre la lumière", - "gigglebot.lightReadSensor|block": "capteur de lumière de %which", - "gigglebot.lightSensorsRaw|block": "données brutes des capteurs de lumière (x2)", - "gigglebot.lineFollow|block": "suivre une ligne noire %type_of_line", - "gigglebot.lineReadSensor|block": "capteur de ligne de %which", - "gigglebot.lineSensorsRaw|block": "données brutes des capteurs de ligne (x2)", - "gigglebot.lineTest|block": "une ligne %which| est détectée", - "gigglebot.motorPowerAssignBoth|block": "régler la puissance du moteur de gauche à %left_power|et celui de droite à | %right_power", - "gigglebot.motorPowerAssign|block": "régler la puissance pour %motor| à | %power", - "gigglebot.motorTrimSet|block": "corriger la direction vers la %dir|par %trim_value", - "gigglebot.servoMove|block": "positioner le servo de %which| à |%degree", - "gigglebot.setSpeed|block": "ajuster la vitesse pour %motor | %speed", - "gigglebot.steerMillisec|block": "courber %percent| vers la %dir| pendant %delay| ms", - "gigglebot.steer|block": "courber %percent| vers la %dir", - "gigglebot.stop|block": "arrêter le Gigglebot", - "gigglebot.turnMillisec|block": "tourner vers la %turn_dir|pendant %delay|ms", - "gigglebot.turn|block": "tourner vers la %turn_dir", - "gigglebot.voltageBattery|block": "voltage de la batterie (mv)", - "gigglebot.voltageShow|block": "afficher le voltage de la batterie (mv)", - "gigglebotEyeAction.Close|block": "fermer", - "gigglebotEyeAction.Open|block": "ouvrir", - "gigglebotInequality.Closer|block": "plus proche que", - "gigglebotInequality.Farther|block": "plus loin que", - "gigglebotLineColor.Black|block": "noire", - "gigglebotLineColor.White|block": "blanche", - "gigglebotLineType.Thick|block": "large", - "gigglebotLineType.Thin|block": "mince", - "gigglebotServoAction.Both|block": "les deux en synchro", - "gigglebotServoAction.Left|block": "gauche", - "gigglebotServoAction.Mirror|block": "les deux en miroir", - "gigglebotServoAction.Right|block": "droite", - "gigglebotWhichDriveDirection.Backward|block": "reculer", - "gigglebotWhichDriveDirection.Forward|block": "avancer", - "gigglebotWhichEye.Both|block": "les deux yeux", - "gigglebotWhichEye.Left|block": "l'oeil gauche", - "gigglebotWhichEye.Right|block": "l'oeil droit", - "gigglebotWhichMotor.Both|block": "les deux moteurs", - "gigglebotWhichMotor.Left|block": "le moteur gauche", - "gigglebotWhichMotor.Right|block": "le moteur droit", - "gigglebotWhichSpeed.Faster|block": "à rapide", - "gigglebotWhichSpeed.Fastest|block": "au plus rapide", - "gigglebotWhichSpeed.Normal|block": "à la vitesse normale", - "gigglebotWhichSpeed.Slower|block": "à lent", - "gigglebotWhichSpeed.Slowest|block": "au plus lent", - "gigglebotWhichTurnDirection.Left|block": "gauche", - "gigglebotWhichTurnDirection.Right|block": "droite", - "gigglebotWhichUniqueMotor.Left|block": "moteur gauche", - "gigglebotWhichUniqueMotor.Right|block": "moteur droit", - "gigglebotWhichUnitSystem.inches|block": "pouces", - "gigglebotWhichUnitSystem.mm|block": "mm", - "gigglebot|block": "gigglebot", - "{id:category}Gigglebot": "Gigglebot" -} \ No newline at end of file + "gigglebot.distanceSensorReadRangeContinuous|block": "distance jusqu'à l'obstacle (mm)", + "gigglebot.distanceSensorTestForObstacle|block": "obstacle se trouve %inequality| %dist| mm", + "gigglebot.driveMillisec|block": "%dir|pendant %delay|ms", + "gigglebot.driveStraight|block": "%dir", + "gigglebot.firmwareVersion|block": "version du firmware", + "gigglebot.gigglebotSpin|block": "pivoter vers la %turn_dir", + "gigglebot.lightFollowStatus|block": "en train de suivre la lumière", + "gigglebot.lightFollow|block": "suivre la lumière", + "gigglebot.lightReadSensor|block": "capteur de lumière de %which", + "gigglebot.lightSensorsRaw|block": "données brutes des capteurs de lumière (x2)", + "gigglebot.lineFollowStatus|block": "en train de suivre une ligne", + "gigglebot.lineFollow|block": "suivre une ligne noire %type_of_line", + "gigglebot.lineReadSensor|block": "capteur de ligne de %which", + "gigglebot.lineSensorsRaw|block": "données brutes des capteurs de ligne (x2)", + "gigglebot.lineTest|block": "une ligne %which| est détectée", + "gigglebot.motorPowerAssignBoth|block": "régler la puissance du moteur de gauche à %left_power|et celui de droite à | %right_power", + "gigglebot.motorPowerAssign|block": "régler la puissance pour %motor| à | %power", + "gigglebot.motorTrimSet|block": "corriger la direction vers la %dir|par %trim_value", + "gigglebot.servoMove|block": "positioner le servo de %which| à |%degree", + "gigglebot.setSpeed|block": "ajuster la vitesse pour %motor | %speed", + "gigglebot.spinMillisec|block": "pivoter vers la %turn_dir|pendant %delay|ms", + "gigglebot.steerMillisec|block": "courber %percent| vers la %dir| pendant %delay| ms", + "gigglebot.steer|block": "courber %percent| vers la %dir", + "gigglebot.stop|block": "arrêter le Gigglebot", + "gigglebot.turnMillisec|block": "tourner vers la %turn_dir|pendant %delay|ms", + "gigglebot.turn|block": "tourner vers la %turn_dir", + "gigglebot.voltageBattery|block": "voltage de la batterie (mv)", + "gigglebot.voltageShow|block": "afficher le voltage de la batterie (mv)", + "gigglebotInequality.Closer|block": "plus proche que", + "gigglebotInequality.Farther|block": "plus loin que", + "gigglebotLightFollowMode.Avoid|block": "éviter", + "gigglebotLightFollowMode.Follow|block": "suivre", + "gigglebotLineColor.Black|block": "noire", + "gigglebotLineColor.White|block": "blanche", + "gigglebotLineType.Thick|block": "large", + "gigglebotLineType.Thin|block": "mince", + "gigglebotServoAction.Both|block": "les deux en synchro", + "gigglebotServoAction.Left|block": "gauche", + "gigglebotServoAction.Mirror|block": "les deux en miroir", + "gigglebotServoAction.Right|block": "droite", + "gigglebotWhichDriveDirection.Backward|block": "reculer", + "gigglebotWhichDriveDirection.Forward|block": "avancer", + "gigglebotWhichMotor.Both|block": "les deux moteurs", + "gigglebotWhichMotor.Left|block": "le moteur gauche", + "gigglebotWhichMotor.Right|block": "le moteur droit", + "gigglebotWhichSpeed.Faster|block": "à rapide", + "gigglebotWhichSpeed.Fastest|block": "au plus rapide", + "gigglebotWhichSpeed.Normal|block": "à la vitesse normale", + "gigglebotWhichSpeed.Slower|block": "à lent", + "gigglebotWhichSpeed.Slowest|block": "au plus lent", + "gigglebotWhichTurnDirection.Left|block": "gauche", + "gigglebotWhichTurnDirection.Right|block": "droite", + "gigglebotWhichUniqueMotor.Left|block": "moteur gauche", + "gigglebotWhichUniqueMotor.Right|block": "moteur droit", + "gigglebotWhichUnitSystem.inches|block": "pouces", + "gigglebotWhichUnitSystem.mm|block": "mm", + "gigglebot|block": "gigglebot", + "{id:category}Gigglebot": "Gigglebot", + "{id:group}DistanceSensor": "Capteur de distance", + "{id:group}Firmware": "Firmware", + "{id:group}LightSensors": "Capteurs de lumière", + "{id:group}LineFollower": "Capteurs de ligne", + "{id:group}OnBoardSensors": "Capteurs embarqués", + "{id:group}Servo": "Servo", + "{id:group}Voltage": "Voltage" + } \ No newline at end of file diff --git a/_locales/gigglebot-jsdoc-strings.json b/_locales/gigglebot-jsdoc-strings.json index 92cff12..29bf160 100644 --- a/_locales/gigglebot-jsdoc-strings.json +++ b/_locales/gigglebot-jsdoc-strings.json @@ -1,52 +1,58 @@ { - "gigglebot": "Custom blocks", - "gigglebot.distanceSensorReadRangeContinuous": "Get a reading of how far an obstacle is from the distanse sensor.", - "gigglebot.distanceSensorReadRangeSingle": "Distance Sensor: takes a single reading.", - "gigglebot.distanceSensorTestForObstacle": "Test for the presence of an obstacle.", - "gigglebot.distanceSensorTestForObstacle|param|dist": "how many millimeters; eg: 100", - "gigglebot.distanceSensorTestForObstacle|param|inequality": "less than or more than, closer than or farther than", - "gigglebot.driveMillisec": "Will let gigglebot move forward or backward for a number of milliseconds.\nDistance covered during that time is related to the freshness of the batteries.", - "gigglebot.driveMillisec|param|delay": "for how many milliseconds; eg: 1000", - "gigglebot.driveMillisec|param|dir": "forward or backward; ", - "gigglebot.driveStraight": "Will let gigglebot move forward or backward until told otherwise (either by a stop block or a turn block).", - "gigglebot.driveStraight|param|dir": "forward or backward", - "gigglebot.followThinLine": "This code allows the Gigglebot to follow a line thin enough to fall between the two sensors. \nThe robot will stop when both of its sensors will detect black.", - "gigglebot.gigglebotSpin": "Gigglebot will spin on itself until told otherwise, like a turn but staying in the same spot. Especially useful when drawing.", - "gigglebot.gigglebotSpinMillisec": "Gigglebot will spin on itself for the provided number of milliseconds, like a turn but staying in the same spot. Especially useful when drawing", - "gigglebot.gigglebotSpinMillisec|param|delay": "how many milliseconds; eg: 1000", - "gigglebot.gigglebotSpinMillisec|param|turn_dir": "turning left or right", - "gigglebot.gigglebotSpin|param|turn_dir": "left or right;", - "gigglebot.leftPower": "return current power setting of the left motor", - "gigglebot.lightFollow": "Will follow a spotlight shone on its eyes. If the spotlight disappears the gigglebot will stop.", - "gigglebot.lightReadSensor": "Reads left or right light sensor. \nThe light sensors are placed in front of each eye neopixel, they're tiny! \nThe range is 0 through 1023, although in reality rarely above ~950.", - "gigglebot.lightReadSensor|param|which": "left or right", - "gigglebot.lineFollow": "A thin black line would fall between the two sensors. The gigglebot will stop when both sensors are reading black.\nA thick black line would have the two sensors on top of it at all times. The gigglebot will stop when both sensors are reading white.", - "gigglebot.lineFollow|param|type_of_line": "thin line or thick line", - "gigglebot.lineReadSensor": "Reads left or right line sensor", - "gigglebot.lineReadSensor|param|which": "left or right", - "gigglebot.lineSensorsRaw": "Reads the two line sensors", - "gigglebot.lineTest": "Will return true if the whole line sensor is reading either black or white.\n@param color: black or white", - "gigglebot.motorPowerAssign": "Assigns power to a motor, or the same power to both motors\nValues from 101 through 127, and -128 through -101 are used to float the motor.\n@param motor: left or right motor, or both\n@param power: a value between -100 and 100", - "gigglebot.motorPowerAssignBoth": "Assigns potentially different powers to both motors in one call. \nValues from 101 through 127, and -128 through -101 are used to float the motor.\n@param left_power: the power to assign to the left motor (between -100 and 100)\n@param right_power: the power to assign to the right motor (between -100 and 100)", - "gigglebot.motorTrimSet": "This allows the user to correct the motors on the Gigglebot if it's not driving straight\n@param dir: if the gigglebot drives to the left, then correct to the right. Vice versa. \n@param trim_value: a correction value between 0 and 100, but most likely below 10", - "gigglebot.rightPower": "return current power setting of the right motor", - "gigglebot.setLeftPower": "Assigns a new power value to the left motor\nValues from 101 through 127, and -128 through -101 are used to float the motor.", - "gigglebot.setLeftPower|param|leftpower": "new value for the power setting of the left motor (-100 < leftpower < 100)", - "gigglebot.setRightPower": "Assigns a new power value to the right motor\nValues from 101 through 127, and -128 through -101 are used to float the motor.", - "gigglebot.setRightPower|param|rightpower": "new value for the power setting of the right motor. (-100 < rightpower < 100)", - "gigglebot.setSpeed": "You can set the speed for each individual motor or both together. The higher the speed the less control the robot has.\nYou may need to correct the robot (see block in \"more...\" section). A faster robot needs more correction than a slower one.\nIf you want to follow a line, it will work best at a lower speed.\nActual speed is dependent on the freshness of the batteries.\n@param motor: left, right or both motors\n@param speed: how fast the robot goes.", - "gigglebot.steer": "Gigglebot will drive forward while steering to one side. \nUseful when it needs to go around an obstacle, or orbit around an object.\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", - "gigglebot.steerMillisec": "Gigglebot will drive forward while steering to one side for the provided number of milliseconds. \nUseful when it needs to go around an obstacle, or orbit around an object.\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", - "gigglebot.steerMillisec|param|delay": "for how many milliseconds; eg: 1000", - "gigglebot.steerMillisec|param|dir": "which direction to steer, left or right", - "gigglebot.steerMillisec|param|percent": "the variation in power between left and right; eg: 0, 20, 50, 100", - "gigglebot.steer|param|dir": "to the left or to the right", - "gigglebot.steer|param|percent": "value between 0 and 100 to control the amount of steering", - "gigglebot.stop": "stops the robot.", - "gigglebot.turn": "Will make gigglebot turn left or right until told otherwise (by a stop block or a drive block).", - "gigglebot.turnMillisec": "Will make gigglebot turn left and right for a number of milliseconds. How far it turns depends on the freshness of the batteries.", - "gigglebot.turnMillisec|param|delay": "for how many milliseconds; eg: 1000", - "gigglebot.turnMillisec|param|turn_dir": "turning left or right", - "gigglebot.voltageShow": "Displays the current battery voltage. Anything lower than 3.4 is too low to run the motors", - "gigglebotWhichUniqueMotor": "Use this file to define custom functions and blocks.\nRead more at https://makecode.microbit.org/blocks/custom" -} \ No newline at end of file + "gigglebot": "Custom blocks", + "gigglebot.distanceSensorReadRangeContinuous": "Get a reading of how far an obstacle is from the distanse sensor.", + "gigglebot.distanceSensorReadRangeSingle": "Distance Sensor: takes a single reading.", + "gigglebot.distanceSensorTestForObstacle": "Test for the presence of an obstacle.", + "gigglebot.distanceSensorTestForObstacle|param|dist": "how many millimeters; eg: 100", + "gigglebot.distanceSensorTestForObstacle|param|inequality": "less than or more than, closer than or farther than", + "gigglebot.driveMillisec": "Will let gigglebot move forward or backward for a number of milliseconds.\r\nDistance covered during that time is related to the freshness of the batteries.", + "gigglebot.driveMillisec|param|delay": "for how many milliseconds; eg: 1000", + "gigglebot.driveMillisec|param|dir": "forward or backward; ", + "gigglebot.driveStraight": "Will let gigglebot move forward or backward until told otherwise (either by a stop block or a turn block).", + "gigglebot.driveStraight|param|dir": "forward or backward", + "gigglebot.gigglebotSpin": "GiggleBot will spin on itself until told otherwise, like a turn but staying in the same spot. Especially useful when drawing.", + "gigglebot.gigglebotSpin|param|turn_dir": "left or right;", + "gigglebot.leftPower": "return current power setting of the left motor", + "gigglebot.lightFollow": "Will follow a spotlight shone on its eyes.", + "gigglebot.lightFollowStatus": "True if robot is currently following light.\r\nFalse otherwise", + "gigglebot.lightFollow|param|light_threshold": "how much light is needed to consider the loop needs to end. This can happen when a light following robot is covered with a box; eg: 10", + "gigglebot.lightFollow|param|mode": "either follow or avoid light", + "gigglebot.lightFollow|param|sensitivity": "how much of a difference between the two sides is needed for Gigglebot to react; eg: 20", + "gigglebot.lightReadSensor": "Reads left or right light sensor. \r\nThe light sensors are placed in front of each eye neopixel, they're tiny! \r\nThe range is 0 through 1023, although in reality rarely above ~950.", + "gigglebot.lightReadSensor|param|which": "left or right", + "gigglebot.lineFollow": "A thin black line would fall between the two sensors. The gigglebot will stop when both sensors are reading black.\r\nA thick black line would have the two sensors on top of it at all times. The gigglebot will stop when both sensors are reading white.\r\nCalling this block puts the GiggleBot into \"Line Follower Mode\". To exit \"Line Follower Mode\" you need to call the \"stop following line\" block.", + "gigglebot.lineFollowStatus": "True if robot is currently following a line.\r\nFalse otherwise", + "gigglebot.lineFollow|param|specific_line_threshold": "overwrite the default line threshold to adapt to your particular tape and lighting condition.", + "gigglebot.lineFollow|param|type_of_line": "thin line or thick line", + "gigglebot.lineReadSensor": "Reads left or right line sensor", + "gigglebot.lineReadSensor|param|which": "left or right", + "gigglebot.lineSensorsRaw": "Reads the two line sensors", + "gigglebot.lineTest": "Will return true if the whole line sensor is reading either black or white.\r\n@param color: black or white", + "gigglebot.motorPowerAssign": "Assigns power to a motor, or the same power to both motors\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.\r\n@param motor: left or right motor, or both\r\n@param power: a value between -100 and 100", + "gigglebot.motorPowerAssignBoth": "Assigns potentially different powers to both motors in one call. \r\nValues from 101 through 127, and -128 through -101 are used to float the motor.\r\n@param left_power: the power to assign to the left motor (between -100 and 100)\r\n@param right_power: the power to assign to the right motor (between -100 and 100)", + "gigglebot.motorTrimSet": "This allows the user to correct the motors on the Gigglebot if it's not driving straight\r\n@param dir: if the gigglebot drives to the left, then correct to the right. Vice versa. \r\n@param trim_value: a correction value between 0 and 100, but most likely below 10", + "gigglebot.rightPower": "return current power setting of the right motor", + "gigglebot.setLeftPower": "Assigns a new power value to the left motor\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.", + "gigglebot.setLeftPower|param|leftpower": "new value for the power setting of the left motor (-100 < leftpower < 100)", + "gigglebot.setLineFollowerThreshold": "A javascript method to change the line follower threshold. \r\nNot exposed as a block", + "gigglebot.setRightPower": "Assigns a new power value to the right motor\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.", + "gigglebot.setRightPower|param|rightpower": "new value for the power setting of the right motor. (-100 < rightpower < 100)", + "gigglebot.setSpeed": "You can set the speed for each individual motor or both together. The higher the speed the less control the robot has.\r\nYou may need to correct the robot (see block in \"more...\" section). A faster robot needs more correction than a slower one.\r\nNote that any drive correction done previously gets applied here.\r\nIf you want to follow a line, it will work best at a lower speed.\r\nActual speed is dependent on the freshness of the batteries.\r\n@param motor: left, right or both motors\r\n@param speed: how fast the robot goes.", + "gigglebot.spinMillisec": "Gigglebot will spin on itself for the provided number of milliseconds, like a turn but staying in the same spot. Especially useful when drawing", + "gigglebot.spinMillisec|param|delay": "how many milliseconds; eg: 1000", + "gigglebot.spinMillisec|param|turn_dir": "turning left or right", + "gigglebot.steer": "Gigglebot will drive forward while steering to one side. \r\nUseful when it needs to go around an obstacle, or orbit around an object.\r\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", + "gigglebot.steerMillisec": "Gigglebot will drive forward while steering to one side for the provided number of milliseconds. \r\nUseful when it needs to go around an obstacle, or orbit around an object.\r\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", + "gigglebot.steerMillisec|param|delay": "for how many milliseconds; eg: 1000", + "gigglebot.steerMillisec|param|dir": "which direction to steer, left or right", + "gigglebot.steerMillisec|param|percent": "the variation in power between left and right; eg: 0, 20, 50, 100", + "gigglebot.steer|param|dir": "to the left or to the right", + "gigglebot.steer|param|percent": "value between 0 and 100 to control the amount of steering", + "gigglebot.stop": "stops the robot.", + "gigglebot.turn": "Will make gigglebot turn left or right until told otherwise (by a stop block or a drive block).", + "gigglebot.turnMillisec": "Will make gigglebot turn left and right for a number of milliseconds. How far it turns depends on the freshness of the batteries.", + "gigglebot.turnMillisec|param|delay": "for how many milliseconds; eg: 1000", + "gigglebot.turnMillisec|param|turn_dir": "turning left or right", + "gigglebot.voltageShow": "Displays the current battery voltage. Anything lower than 3.4 is too low to run the motors", + "gigglebotWhichUniqueMotor": "Use this file to define custom functions and blocks.\r\nRead more at https://makecode.microbit.org/blocks/custom" + } \ No newline at end of file diff --git a/_locales/gigglebot-strings.json b/_locales/gigglebot-strings.json index 91562fb..863b121 100644 --- a/_locales/gigglebot-strings.json +++ b/_locales/gigglebot-strings.json @@ -1,61 +1,67 @@ { - "gigglebot.distanceSensorReadRangeContinuous|block": "distance to obstacle (mm)", - "gigglebot.distanceSensorTestForObstacle|block": "obstacle is %inequality| %dist| mm", - "gigglebot.driveMillisec|block": "drive %dir|for %delay|ms", - "gigglebot.driveStraight|block": "drive %dir", - "gigglebot.firmwareVersion|block": "firmware version number", - "gigglebot.gigglebotSpinMillisec|block": "spin %turn_dir|for %delay|ms", - "gigglebot.gigglebotSpin|block": "spin %turn_dir", - "gigglebot.lightFollow|block": "follow light", - "gigglebot.lightReadSensor|block": "%which|light sensor", - "gigglebot.lightSensorsRaw|block": "raw light sensors (x2)", - "gigglebot.lineFollow|block": "follow a %type_of_line| black line", - "gigglebot.lineReadSensor|block": "%which|line sensor", - "gigglebot.lineSensorsRaw|block": "raw line sensors (x2)", - "gigglebot.lineTest|block": "%which|line is detected", - "gigglebot.motorPowerAssignBoth|block": "set left power to %left_power|and right to | %right_power", - "gigglebot.motorPowerAssign|block": "set power on %motor| to | %power", - "gigglebot.motorTrimSet|block": "correct towards %dir|by %trim_value", - "gigglebot.servoMove|block": "set %which|servo to |%degree", - "gigglebot.setSpeed|block": "set %motor | speed to %speed", - "gigglebot.steerMillisec|block": "steer %percent| towards the %dir| for %delay| ms", - "gigglebot.steer|block": "steer %percent| towards the %dir", - "gigglebot.stop|block": "stop", - "gigglebot.turnMillisec|block": "turn %turn_dir|for %delay|ms", - "gigglebot.turn|block": "turn %turn_dir", - "gigglebot.voltageBattery|block": "battery voltage (mv)", - "gigglebot.voltageShow|block": "show battery voltage (mv)", - "gigglebotEyeAction.Close|block": "close", - "gigglebotEyeAction.Open|block": "open", - "gigglebotInequality.Closer|block": "closer than", - "gigglebotInequality.Farther|block": "farther than", - "gigglebotLineColor.Black|block": "black", - "gigglebotLineColor.White|block": "white", - "gigglebotLineType.Thick|block": "thick", - "gigglebotLineType.Thin|block": "thin", - "gigglebotServoAction.Both|block": "both in synchro", - "gigglebotServoAction.Left|block": "left", - "gigglebotServoAction.Mirror|block": "both in mirror", - "gigglebotServoAction.Right|block": "right", - "gigglebotWhichDriveDirection.Backward|block": "backward", - "gigglebotWhichDriveDirection.Forward|block": "forward", - "gigglebotWhichEye.Both|block": "both eyes", - "gigglebotWhichEye.Left|block": "left eye", - "gigglebotWhichEye.Right|block": "right eye", - "gigglebotWhichMotor.Both|block": "both motors", - "gigglebotWhichMotor.Left|block": "left motor", - "gigglebotWhichMotor.Right|block": "right motor", - "gigglebotWhichSpeed.Faster|block": "faster", - "gigglebotWhichSpeed.Fastest|block": "fastest", - "gigglebotWhichSpeed.Normal|block": "normal", - "gigglebotWhichSpeed.Slower|block": "slower", - "gigglebotWhichSpeed.Slowest|block": "slowest", - "gigglebotWhichTurnDirection.Left|block": "left", - "gigglebotWhichTurnDirection.Right|block": "right", - "gigglebotWhichUniqueMotor.Left|block": "left motor", - "gigglebotWhichUniqueMotor.Right|block": "right motor", - "gigglebotWhichUnitSystem.inches|block": "inches", - "gigglebotWhichUnitSystem.mm|block": "mm", - "gigglebot|block": "gigglebot", - "{id:category}Gigglebot": "Gigglebot" -} \ No newline at end of file + "gigglebot.distanceSensorReadRangeContinuous|block": "distance to obstacle (mm)", + "gigglebot.distanceSensorTestForObstacle|block": "obstacle is %inequality| %dist| mm", + "gigglebot.driveMillisec|block": "drive %dir|for %delay|ms", + "gigglebot.driveStraight|block": "drive %dir", + "gigglebot.firmwareVersion|block": "firmware version number", + "gigglebot.gigglebotSpin|block": "spin %turn_dir", + "gigglebot.lightFollowStatus|block": "following light", + "gigglebot.lightFollow|block": "follow light", + "gigglebot.lightReadSensor|block": "%which|light sensor", + "gigglebot.lightSensorsRaw|block": "raw light sensors (x2)", + "gigglebot.lineFollowStatus|block": "following line", + "gigglebot.lineFollow|block": "follow a %type_of_line| black line", + "gigglebot.lineReadSensor|block": "%which|line sensor", + "gigglebot.lineSensorsRaw|block": "raw line sensors (x2)", + "gigglebot.lineTest|block": "%which|line is detected", + "gigglebot.motorPowerAssignBoth|block": "set left power to %left_power|and right to | %right_power", + "gigglebot.motorPowerAssign|block": "set power on %motor| to | %power", + "gigglebot.motorTrimSet|block": "correct towards %dir|by %trim_value", + "gigglebot.servoMove|block": "set %which|servo to |%degree", + "gigglebot.setSpeed|block": "set %motor | speed to %speed", + "gigglebot.spinMillisec|block": "spin %turn_dir|for %delay|ms", + "gigglebot.steerMillisec|block": "steer %percent| towards the %dir| for %delay| ms", + "gigglebot.steer|block": "steer %percent| towards the %dir", + "gigglebot.stop|block": "stop", + "gigglebot.turnMillisec|block": "turn %turn_dir|for %delay|ms", + "gigglebot.turn|block": "turn %turn_dir", + "gigglebot.voltageBattery|block": "battery voltage (mv)", + "gigglebot.voltageShow|block": "show battery voltage (mv)", + "gigglebotInequality.Closer|block": "closer than", + "gigglebotInequality.Farther|block": "farther than", + "gigglebotLightFollowMode.Avoid|block": "avoid", + "gigglebotLightFollowMode.Follow|block": "follow", + "gigglebotLineColor.Black|block": "black", + "gigglebotLineColor.White|block": "white", + "gigglebotLineType.Thick|block": "thick", + "gigglebotLineType.Thin|block": "thin", + "gigglebotServoAction.Both|block": "both in synchro", + "gigglebotServoAction.Left|block": "left", + "gigglebotServoAction.Mirror|block": "both in mirror", + "gigglebotServoAction.Right|block": "right", + "gigglebotWhichDriveDirection.Backward|block": "backward", + "gigglebotWhichDriveDirection.Forward|block": "forward", + "gigglebotWhichMotor.Both|block": "both motors", + "gigglebotWhichMotor.Left|block": "left motor", + "gigglebotWhichMotor.Right|block": "right motor", + "gigglebotWhichSpeed.Faster|block": "faster", + "gigglebotWhichSpeed.Fastest|block": "fastest", + "gigglebotWhichSpeed.Normal|block": "normal", + "gigglebotWhichSpeed.Slower|block": "slower", + "gigglebotWhichSpeed.Slowest|block": "slowest", + "gigglebotWhichTurnDirection.Left|block": "left", + "gigglebotWhichTurnDirection.Right|block": "right", + "gigglebotWhichUniqueMotor.Left|block": "left motor", + "gigglebotWhichUniqueMotor.Right|block": "right motor", + "gigglebotWhichUnitSystem.inches|block": "inches", + "gigglebotWhichUnitSystem.mm|block": "mm", + "gigglebot|block": "gigglebot", + "{id:category}Gigglebot": "Gigglebot", + "{id:group}DistanceSensor": "DistanceSensor", + "{id:group}Firmware": "Firmware", + "{id:group}LightSensors": "LightSensors", + "{id:group}LineFollower": "LineFollower", + "{id:group}OnBoardSensors": "OnBoardSensors", + "{id:group}Servo": "Servo", + "{id:group}Voltage": "Voltage" + } \ No newline at end of file From 2073504154ce03ff438695bf736e91c3fa7caef1 Mon Sep 17 00:00:00 2001 From: CleoQc Date: Sun, 9 Dec 2018 14:44:20 -0500 Subject: [PATCH 11/17] Fix GiggleBot spelling --- _locales/fr/gigglebot-strings.json | 4 ++-- _locales/gigglebot-strings.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_locales/fr/gigglebot-strings.json b/_locales/fr/gigglebot-strings.json index 225ab10..a97ba3a 100644 --- a/_locales/fr/gigglebot-strings.json +++ b/_locales/fr/gigglebot-strings.json @@ -22,7 +22,7 @@ "gigglebot.spinMillisec|block": "pivoter vers la %turn_dir|pendant %delay|ms", "gigglebot.steerMillisec|block": "courber %percent| vers la %dir| pendant %delay| ms", "gigglebot.steer|block": "courber %percent| vers la %dir", - "gigglebot.stop|block": "arrêter le Gigglebot", + "gigglebot.stop|block": "arrêter le GiggleBot", "gigglebot.turnMillisec|block": "tourner vers la %turn_dir|pendant %delay|ms", "gigglebot.turn|block": "tourner vers la %turn_dir", "gigglebot.voltageBattery|block": "voltage de la batterie (mv)", @@ -55,7 +55,7 @@ "gigglebotWhichUniqueMotor.Right|block": "moteur droit", "gigglebotWhichUnitSystem.inches|block": "pouces", "gigglebotWhichUnitSystem.mm|block": "mm", - "gigglebot|block": "gigglebot", + "gigglebot|block": "GiggleBot", "{id:category}Gigglebot": "Gigglebot", "{id:group}DistanceSensor": "Capteur de distance", "{id:group}Firmware": "Firmware", diff --git a/_locales/gigglebot-strings.json b/_locales/gigglebot-strings.json index 863b121..5de1e73 100644 --- a/_locales/gigglebot-strings.json +++ b/_locales/gigglebot-strings.json @@ -55,8 +55,8 @@ "gigglebotWhichUniqueMotor.Right|block": "right motor", "gigglebotWhichUnitSystem.inches|block": "inches", "gigglebotWhichUnitSystem.mm|block": "mm", - "gigglebot|block": "gigglebot", - "{id:category}Gigglebot": "Gigglebot", + "gigglebot|block": "giggleBot", + "{id:category}Gigglebot": "GiggleBot", "{id:group}DistanceSensor": "DistanceSensor", "{id:group}Firmware": "Firmware", "{id:group}LightSensors": "LightSensors", From 2b8619b92a0660a8ac9ad1404354c479c26e991a Mon Sep 17 00:00:00 2001 From: CleoQc Date: Sun, 9 Dec 2018 14:47:31 -0500 Subject: [PATCH 12/17] Fix GiggleBot spelling --- _locales/fr/gigglebot-jsdoc-strings.json | 114 +++++++++++------------ _locales/gigglebot-jsdoc-strings.json | 20 ++-- 2 files changed, 67 insertions(+), 67 deletions(-) diff --git a/_locales/fr/gigglebot-jsdoc-strings.json b/_locales/fr/gigglebot-jsdoc-strings.json index 6689559..546ab1f 100644 --- a/_locales/fr/gigglebot-jsdoc-strings.json +++ b/_locales/fr/gigglebot-jsdoc-strings.json @@ -1,58 +1,58 @@ { - "gigglebot": "blocs", - "gigglebot.distanceSensorReadRangeContinuous": "Prendre une lecture de la distance jusqu'à l'obstacle", - "gigglebot.distanceSensorReadRangeSingle": "Prendre une lecture simple de la distance", - "gigglebot.distanceSensorTestForObstacle": "Tester la présence d'un obstacle", - "gigglebot.distanceSensorTestForObstacle|param|dist": "combien de millimètres; eg: 100", - "gigglebot.distanceSensorTestForObstacle|param|inequality": "moins que ou plus que, plus proche que ou plus loin que", - "gigglebot.driveMillisec": "Le GiggleBot avancera ou reculera pendant un certain nombre de millisecondes\nLa distance parcourue pendant ce temps dépend de la puissance des batteries.", - "gigglebot.driveMillisec|param|delay": "pendant combien de millisecondes; eg: 1000", - "gigglebot.driveMillisec|param|dir": "avancer ou reculer", - "gigglebot.driveStraight": "Le GiggleBot avancera ou reculera jusqu'à ordre contraire (soit par un bloc Arrêt ou un autre bloc).", - "gigglebot.driveStraight|param|dir": "avancer ou reculer", - "gigglebot.gigglebotSpin": "Le GiggleBot pivotera sur lui-même jusqu'à ordre contraire, en restant sur place. Particulièrement utile pour dessiner.", - "gigglebot.gigglebotSpin|param|turn_dir": "vers la gauche ou vers la droite;", - "gigglebot.leftPower": "la puissance du moteur de gauche", - "gigglebot.lightFollow": "Le GiggleBot ira vers la lumière. Si le robot se retrouve dans le noir, il arrêtera.", - "gigglebot.lightFollowStatus": "Vrai si le robot est présentement en train de suivre une lumière.\r\nFaux autrement.", - "gigglebot.lightFollow|param|light_threshold": "la quantité de luminosité requise pour considérer que le GigleBot est dans le noir, par exemple s'il est emprisonné dans une boîte; eg: 10", - "gigglebot.lightFollow|param|mode": "suivre ou éviter la lumière", - "gigglebot.lightFollow|param|sensitivity": "la différence requise entre les deux capteurs de lumière pour faire tourner le GiggleBot; eg: 20", - "gigglebot.lightReadSensor": "Lire le capteur de lumière de gauche ou de droite. \nLes capteurs de lumière sont situés juste en avant des yeux, ils sont tout petits!\nLes valeurs vont de 0 à 1023, en réalité rarement plus que ~950.", - "gigglebot.lightReadSensor|param|which": "gauche ou droite", - "gigglebot.lineFollow": "Une ligne mince passera entre les deux capteurs et le GiggleBot arrêtera lorsque les deux capteurs détecteront du noir.\nUne large ligne noire sera plus large que la distance entre les deux capteurs. Le GiggleBot arrêtera lorsque les deux capteurs détecteront du blanc.", - "gigglebot.lineFollowStatus": "Vrai lorsque le robot suit une ligne.\r\nFalx autrement.", - "gigglebot.lineFollow|param|specific_line_threshold": "modifie la valeur par défaut du seuil de détection d'une ligne pour une meilleure adaptation à l'environnement du GiggleBot.", - "gigglebot.lineFollow|param|type_of_line": "ligne large ou mince.", - "gigglebot.lineReadSensor": "Lit le capteur de gauche ou de droite.", - "gigglebot.lineReadSensor|param|which": "gauche ou droite", - "gigglebot.lineSensorsRaw": "Lit les deux capteurs", - "gigglebot.lineTest": "Vrai si les deux capteurs détectent soit du noir, soit du blanc.\n@param color: noir ou blanc", - "gigglebot.motorPowerAssign": "Assigne une puissance à un moteur, ou la même puissance aux deux moteurs\nLes valeurs possibles vont de 101 à 127, et les valeurs de -128 à -101 sont utilisés pour laisser le moteur aller sur son élan.\n@param motor: moteur de gauche ou de droite, ou les deux\n@param power: une valeur entre -100 et 100", - "gigglebot.motorPowerAssignBoth": "Assigne de nouvelles puissances potentiellement différentes aux deux moteurs en un seul bloc. \nValues from 101 through 127, and -128 through -101 are used to float the motor.\n@param left_power: la puissance du moteur de gauche (entre -100 et 100)\n@param right_power: la puissance du moteur de droite (entre -100 et 100)", - "gigglebot.motorTrimSet": "Permet de corriger les moteurs lorsque le GiggleBot ne se déplace pas en ligne droite.\r\n@param dir: si le GiggleBot dévie vers la gauche, corriger vers la droite ou vice versa. \r\n@param trim_value: une valeur de correction entre 0 et 100, probablement en deça de 10", - "gigglebot.rightPower": "la valeur courante de la puissance du moteur de droite", - "gigglebot.setLeftPower": "Assigne une puissance au moteur de gauche\nLes valeurs possibles vont de 101 à 127, et les valeurs de -128 à -101 sont utilisés pour laisser le moteur aller sur son élan.\n@param motor: moteur de gauche ou de droite, ou les deux\n@param power: une valeur entre -100 et 100", - "gigglebot.setLeftPower|param|leftpower": "nouvelle valeur de la puissance du moteur de gauche (-100 < leftpower < 100). Les valeurs de 101 à 127 ou de -128 à -101 privent le moteur de sa puissance.", - "gigglebot.setLineFollowerThreshold": "Une méthode purement Javascript permettant de changer le seuil de réponse du détecteur de ligne.", - "gigglebot.setRightPower": "Assigne une puissance au moteur de droite\nLes valeurs possibles vont de 101 à 127, et les valeurs de -128 à -101 sont utilisés pour laisser le moteur aller sur son élan.\n@param motor: moteur de gauche ou de droite, ou les deux\n@param power: une valeur entre -100 et 100", - "gigglebot.setRightPower|param|rightpower": "nouvelle valeur de la puissance du moteur de droite (-100 < leftpower < 100). Les valeurs de 101 à 127 ou de -128 à -101 privent le moteur de sa puissance.", - "gigglebot.setSpeed": "Ajuster la vitesse de chacun des moteurs, ou les deux en même temps. Plus le GiggleBot va vite, moins il sera précis.\nIl est possible que les moteurs aient besoin d'être corrigés avec le bloc correspondant. Plus le GiggleBot est rapide plus il aura besoin de correction\nPour suivre une ligne il est préférable d'y aller à vitesse lente.\nLa vitesse dépend de la puissance des batteries.\n@param motor: gauche, droite, ou les deux\n@param speed: la vitesse du robot.", - "gigglebot.SpinMillisec": "Le Gigglebot pivotera sur place pendant X millisecondes, en restant sur place. Très pratique pour dessiner.", - "gigglebot.SpinMillisec|param|delay": "combien de millisecondes; eg: 1000", - "gigglebot.SpinMillisec|param|turn_dir": "tourner vers la gauche ou vers la droite", - "gigglebot.steer": "Le Gigglebot avancera en courbant vers la droite ou la gauche.\nUtile pour contourner un obstacle ou pour être en orbite autour d'un objet.\n0% indique aucune courbure et revient à avancer, 100% donne le même résultat que le bloc Tourner", - "gigglebot.steerMillisec": "Le Gigglebot avancera en courbant vers la droite ou la gauche pendant X milliseconded. \nUtile pour contourner un obstacle ou pour être en orbite autour d'un objet.\n0% indique aucune courbure et revient à avancer, 100% donne le même résultat que le bloc Tourner", - "gigglebot.steerMillisec|param|delay": "combien de millisecondes; eg: 1000", - "gigglebot.steerMillisec|param|dir": "courber vers la droite ou vers la gauche", - "gigglebot.steerMillisec|param|percent": "la différence de puissance entre le moteur gauche et le moteur droit; eg: 0, 20, 50, 100", - "gigglebot.steer|param|dir": "vers la droite ou vers la gauche", - "gigglebot.steer|param|percent": "une valeur entre 0 et 100 qui contrôle la courbe", - "gigglebot.stop": "Arrêter le robot.", - "gigglebot.turn": "Le GiggleBot tournera vers la gauche ou la droite tant qu'un autre bloc ne l'interrompe.", - "gigglebot.turnMillisec": "Le GiggleBot tournera vers la gauche ou la droite pendant X millisecondes.", - "gigglebot.turnMillisec|param|delay": "combien de millisecondes; eg: 1000", - "gigglebot.turnMillisec|param|turn_dir": "vers la gauche ou vers la droite", - "gigglebot.voltageShow": "Affiche le voltage des batteries. Moins que 3.4 indique des batteries trop faibles pour faire bouger le GiggleBot", - "gigglebotWhichUniqueMotor": "" -} \ No newline at end of file + "gigglebot": "blocs", + "gigglebot.distanceSensorReadRangeContinuous": "Prendre une lecture de la distance jusqu'à l'obstacle", + "gigglebot.distanceSensorReadRangeSingle": "Prendre une lecture simple de la distance", + "gigglebot.distanceSensorTestForObstacle": "Tester la présence d'un obstacle", + "gigglebot.distanceSensorTestForObstacle|param|dist": "combien de millimètres; eg: 100", + "gigglebot.distanceSensorTestForObstacle|param|inequality": "moins que ou plus que, plus proche que ou plus loin que", + "gigglebot.driveMillisec": "Le GiggleBot avancera ou reculera pendant un certain nombre de millisecondes\nLa distance parcourue pendant ce temps dépend de la puissance des batteries.", + "gigglebot.driveMillisec|param|delay": "pendant combien de millisecondes; eg: 1000", + "gigglebot.driveMillisec|param|dir": "avancer ou reculer", + "gigglebot.driveStraight": "Le GiggleBot avancera ou reculera jusqu'à ordre contraire (soit par un bloc Arrêt ou un autre bloc).", + "gigglebot.driveStraight|param|dir": "avancer ou reculer", + "gigglebot.gigglebotSpin": "Le GiggleBot pivotera sur lui-même jusqu'à ordre contraire, en restant sur place. Particulièrement utile pour dessiner.", + "gigglebot.gigglebotSpin|param|turn_dir": "vers la gauche ou vers la droite;", + "gigglebot.leftPower": "la puissance du moteur de gauche", + "gigglebot.lightFollow": "Le GiggleBot ira vers la lumière. Si le robot se retrouve dans le noir, il arrêtera.", + "gigglebot.lightFollowStatus": "Vrai si le robot est présentement en train de suivre une lumière.\r\nFaux autrement.", + "gigglebot.lightFollow|param|light_threshold": "la quantité de luminosité requise pour considérer que le GigleBot est dans le noir, par exemple s'il est emprisonné dans une boîte; eg: 10", + "gigglebot.lightFollow|param|mode": "suivre ou éviter la lumière", + "gigglebot.lightFollow|param|sensitivity": "la différence requise entre les deux capteurs de lumière pour faire tourner le GiggleBot; eg: 20", + "gigglebot.lightReadSensor": "Lire le capteur de lumière de gauche ou de droite. \nLes capteurs de lumière sont situés juste en avant des yeux, ils sont tout petits!\nLes valeurs vont de 0 à 1023, en réalité rarement plus que ~950.", + "gigglebot.lightReadSensor|param|which": "gauche ou droite", + "gigglebot.lineFollow": "Une ligne mince passera entre les deux capteurs et le GiggleBot arrêtera lorsque les deux capteurs détecteront du noir.\nUne large ligne noire sera plus large que la distance entre les deux capteurs. Le GiggleBot arrêtera lorsque les deux capteurs détecteront du blanc.", + "gigglebot.lineFollowStatus": "Vrai lorsque le robot suit une ligne.\r\nFalx autrement.", + "gigglebot.lineFollow|param|specific_line_threshold": "modifie la valeur par défaut du seuil de détection d'une ligne pour une meilleure adaptation à l'environnement du GiggleBot.", + "gigglebot.lineFollow|param|type_of_line": "ligne large ou mince.", + "gigglebot.lineReadSensor": "Lit le capteur de gauche ou de droite.", + "gigglebot.lineReadSensor|param|which": "gauche ou droite", + "gigglebot.lineSensorsRaw": "Lit les deux capteurs", + "gigglebot.lineTest": "Vrai si les deux capteurs détectent soit du noir, soit du blanc.\n@param color: noir ou blanc", + "gigglebot.motorPowerAssign": "Assigne une puissance à un moteur, ou la même puissance aux deux moteurs\nLes valeurs possibles vont de 101 à 127, et les valeurs de -128 à -101 sont utilisés pour laisser le moteur aller sur son élan.\n@param motor: moteur de gauche ou de droite, ou les deux\n@param power: une valeur entre -100 et 100", + "gigglebot.motorPowerAssignBoth": "Assigne de nouvelles puissances potentiellement différentes aux deux moteurs en un seul bloc. \nValues from 101 through 127, and -128 through -101 are used to float the motor.\n@param left_power: la puissance du moteur de gauche (entre -100 et 100)\n@param right_power: la puissance du moteur de droite (entre -100 et 100)", + "gigglebot.motorTrimSet": "Permet de corriger les moteurs lorsque le GiggleBot ne se déplace pas en ligne droite.\r\n@param dir: si le GiggleBot dévie vers la gauche, corriger vers la droite ou vice versa. \r\n@param trim_value: une valeur de correction entre 0 et 100, probablement en deça de 10", + "gigglebot.rightPower": "la valeur courante de la puissance du moteur de droite", + "gigglebot.setLeftPower": "Assigne une puissance au moteur de gauche\nLes valeurs possibles vont de 101 à 127, et les valeurs de -128 à -101 sont utilisés pour laisser le moteur aller sur son élan.\n@param motor: moteur de gauche ou de droite, ou les deux\n@param power: une valeur entre -100 et 100", + "gigglebot.setLeftPower|param|leftpower": "nouvelle valeur de la puissance du moteur de gauche (-100 < leftpower < 100). Les valeurs de 101 à 127 ou de -128 à -101 privent le moteur de sa puissance.", + "gigglebot.setLineFollowerThreshold": "Une méthode purement Javascript permettant de changer le seuil de réponse du détecteur de ligne.", + "gigglebot.setRightPower": "Assigne une puissance au moteur de droite\nLes valeurs possibles vont de 101 à 127, et les valeurs de -128 à -101 sont utilisés pour laisser le moteur aller sur son élan.\n@param motor: moteur de gauche ou de droite, ou les deux\n@param power: une valeur entre -100 et 100", + "gigglebot.setRightPower|param|rightpower": "nouvelle valeur de la puissance du moteur de droite (-100 < leftpower < 100). Les valeurs de 101 à 127 ou de -128 à -101 privent le moteur de sa puissance.", + "gigglebot.setSpeed": "Ajuster la vitesse de chacun des moteurs, ou les deux en même temps. Plus le GiggleBot va vite, moins il sera précis.\nIl est possible que les moteurs aient besoin d'être corrigés avec le bloc correspondant. Plus le GiggleBot est rapide plus il aura besoin de correction\nPour suivre une ligne il est préférable d'y aller à vitesse lente.\nLa vitesse dépend de la puissance des batteries.\n@param motor: gauche, droite, ou les deux\n@param speed: la vitesse du robot.", + "gigglebot.SpinMillisec": "Le GiggleBot pivotera sur place pendant X millisecondes, en restant sur place. Très pratique pour dessiner.", + "gigglebot.SpinMillisec|param|delay": "combien de millisecondes; eg: 1000", + "gigglebot.SpinMillisec|param|turn_dir": "tourner vers la gauche ou vers la droite", + "gigglebot.steer": "Le GiggleBot avancera en courbant vers la droite ou la gauche.\nUtile pour contourner un obstacle ou pour être en orbite autour d'un objet.\n0% indique aucune courbure et revient à avancer, 100% donne le même résultat que le bloc Tourner", + "gigglebot.steerMillisec": "Le GiggleBot avancera en courbant vers la droite ou la gauche pendant X milliseconded. \nUtile pour contourner un obstacle ou pour être en orbite autour d'un objet.\n0% indique aucune courbure et revient à avancer, 100% donne le même résultat que le bloc Tourner", + "gigglebot.steerMillisec|param|delay": "combien de millisecondes; eg: 1000", + "gigglebot.steerMillisec|param|dir": "courber vers la droite ou vers la gauche", + "gigglebot.steerMillisec|param|percent": "la différence de puissance entre le moteur gauche et le moteur droit; eg: 0, 20, 50, 100", + "gigglebot.steer|param|dir": "vers la droite ou vers la gauche", + "gigglebot.steer|param|percent": "une valeur entre 0 et 100 qui contrôle la courbe", + "gigglebot.stop": "Arrêter le robot.", + "gigglebot.turn": "Le GiggleBot tournera vers la gauche ou la droite tant qu'un autre bloc ne l'interrompe.", + "gigglebot.turnMillisec": "Le GiggleBot tournera vers la gauche ou la droite pendant X millisecondes.", + "gigglebot.turnMillisec|param|delay": "combien de millisecondes; eg: 1000", + "gigglebot.turnMillisec|param|turn_dir": "vers la gauche ou vers la droite", + "gigglebot.voltageShow": "Affiche le voltage des batteries. Moins que 3.4 indique des batteries trop faibles pour faire bouger le GiggleBot", + "gigglebotWhichUniqueMotor": "" + } \ No newline at end of file diff --git a/_locales/gigglebot-jsdoc-strings.json b/_locales/gigglebot-jsdoc-strings.json index 29bf160..b753114 100644 --- a/_locales/gigglebot-jsdoc-strings.json +++ b/_locales/gigglebot-jsdoc-strings.json @@ -5,10 +5,10 @@ "gigglebot.distanceSensorTestForObstacle": "Test for the presence of an obstacle.", "gigglebot.distanceSensorTestForObstacle|param|dist": "how many millimeters; eg: 100", "gigglebot.distanceSensorTestForObstacle|param|inequality": "less than or more than, closer than or farther than", - "gigglebot.driveMillisec": "Will let gigglebot move forward or backward for a number of milliseconds.\r\nDistance covered during that time is related to the freshness of the batteries.", + "gigglebot.driveMillisec": "Will let GiggleBot move forward or backward for a number of milliseconds.\r\nDistance covered during that time is related to the freshness of the batteries.", "gigglebot.driveMillisec|param|delay": "for how many milliseconds; eg: 1000", "gigglebot.driveMillisec|param|dir": "forward or backward; ", - "gigglebot.driveStraight": "Will let gigglebot move forward or backward until told otherwise (either by a stop block or a turn block).", + "gigglebot.driveStraight": "Will let GiggleBot move forward or backward until told otherwise (either by a stop block or a turn block).", "gigglebot.driveStraight|param|dir": "forward or backward", "gigglebot.gigglebotSpin": "GiggleBot will spin on itself until told otherwise, like a turn but staying in the same spot. Especially useful when drawing.", "gigglebot.gigglebotSpin|param|turn_dir": "left or right;", @@ -17,10 +17,10 @@ "gigglebot.lightFollowStatus": "True if robot is currently following light.\r\nFalse otherwise", "gigglebot.lightFollow|param|light_threshold": "how much light is needed to consider the loop needs to end. This can happen when a light following robot is covered with a box; eg: 10", "gigglebot.lightFollow|param|mode": "either follow or avoid light", - "gigglebot.lightFollow|param|sensitivity": "how much of a difference between the two sides is needed for Gigglebot to react; eg: 20", + "gigglebot.lightFollow|param|sensitivity": "how much of a difference between the two sides is needed for GiggleBot to react; eg: 20", "gigglebot.lightReadSensor": "Reads left or right light sensor. \r\nThe light sensors are placed in front of each eye neopixel, they're tiny! \r\nThe range is 0 through 1023, although in reality rarely above ~950.", "gigglebot.lightReadSensor|param|which": "left or right", - "gigglebot.lineFollow": "A thin black line would fall between the two sensors. The gigglebot will stop when both sensors are reading black.\r\nA thick black line would have the two sensors on top of it at all times. The gigglebot will stop when both sensors are reading white.\r\nCalling this block puts the GiggleBot into \"Line Follower Mode\". To exit \"Line Follower Mode\" you need to call the \"stop following line\" block.", + "gigglebot.lineFollow": "A thin black line would fall between the two sensors. The GiggleBot will stop when both sensors are reading black.\r\nA thick black line would have the two sensors on top of it at all times. The GiggleBot will stop when both sensors are reading white.\r\nCalling this block puts the GiggleBot into \"Line Follower Mode\". To exit \"Line Follower Mode\" you need to call the \"stop following line\" block.", "gigglebot.lineFollowStatus": "True if robot is currently following a line.\r\nFalse otherwise", "gigglebot.lineFollow|param|specific_line_threshold": "overwrite the default line threshold to adapt to your particular tape and lighting condition.", "gigglebot.lineFollow|param|type_of_line": "thin line or thick line", @@ -30,7 +30,7 @@ "gigglebot.lineTest": "Will return true if the whole line sensor is reading either black or white.\r\n@param color: black or white", "gigglebot.motorPowerAssign": "Assigns power to a motor, or the same power to both motors\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.\r\n@param motor: left or right motor, or both\r\n@param power: a value between -100 and 100", "gigglebot.motorPowerAssignBoth": "Assigns potentially different powers to both motors in one call. \r\nValues from 101 through 127, and -128 through -101 are used to float the motor.\r\n@param left_power: the power to assign to the left motor (between -100 and 100)\r\n@param right_power: the power to assign to the right motor (between -100 and 100)", - "gigglebot.motorTrimSet": "This allows the user to correct the motors on the Gigglebot if it's not driving straight\r\n@param dir: if the gigglebot drives to the left, then correct to the right. Vice versa. \r\n@param trim_value: a correction value between 0 and 100, but most likely below 10", + "gigglebot.motorTrimSet": "This allows the user to correct the motors on the GiggleBot if it's not driving straight\r\n@param dir: if the GiggleBot drives to the left, then correct to the right. Vice versa. \r\n@param trim_value: a correction value between 0 and 100, but most likely below 10", "gigglebot.rightPower": "return current power setting of the right motor", "gigglebot.setLeftPower": "Assigns a new power value to the left motor\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.", "gigglebot.setLeftPower|param|leftpower": "new value for the power setting of the left motor (-100 < leftpower < 100)", @@ -38,19 +38,19 @@ "gigglebot.setRightPower": "Assigns a new power value to the right motor\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.", "gigglebot.setRightPower|param|rightpower": "new value for the power setting of the right motor. (-100 < rightpower < 100)", "gigglebot.setSpeed": "You can set the speed for each individual motor or both together. The higher the speed the less control the robot has.\r\nYou may need to correct the robot (see block in \"more...\" section). A faster robot needs more correction than a slower one.\r\nNote that any drive correction done previously gets applied here.\r\nIf you want to follow a line, it will work best at a lower speed.\r\nActual speed is dependent on the freshness of the batteries.\r\n@param motor: left, right or both motors\r\n@param speed: how fast the robot goes.", - "gigglebot.spinMillisec": "Gigglebot will spin on itself for the provided number of milliseconds, like a turn but staying in the same spot. Especially useful when drawing", + "gigglebot.spinMillisec": "GiggleBot will spin on itself for the provided number of milliseconds, like a turn but staying in the same spot. Especially useful when drawing", "gigglebot.spinMillisec|param|delay": "how many milliseconds; eg: 1000", "gigglebot.spinMillisec|param|turn_dir": "turning left or right", - "gigglebot.steer": "Gigglebot will drive forward while steering to one side. \r\nUseful when it needs to go around an obstacle, or orbit around an object.\r\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", - "gigglebot.steerMillisec": "Gigglebot will drive forward while steering to one side for the provided number of milliseconds. \r\nUseful when it needs to go around an obstacle, or orbit around an object.\r\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", + "gigglebot.steer": "GiggleBot will drive forward while steering to one side. \r\nUseful when it needs to go around an obstacle, or orbit around an object.\r\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", + "gigglebot.steerMillisec": "GiggleBot will drive forward while steering to one side for the provided number of milliseconds. \r\nUseful when it needs to go around an obstacle, or orbit around an object.\r\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", "gigglebot.steerMillisec|param|delay": "for how many milliseconds; eg: 1000", "gigglebot.steerMillisec|param|dir": "which direction to steer, left or right", "gigglebot.steerMillisec|param|percent": "the variation in power between left and right; eg: 0, 20, 50, 100", "gigglebot.steer|param|dir": "to the left or to the right", "gigglebot.steer|param|percent": "value between 0 and 100 to control the amount of steering", "gigglebot.stop": "stops the robot.", - "gigglebot.turn": "Will make gigglebot turn left or right until told otherwise (by a stop block or a drive block).", - "gigglebot.turnMillisec": "Will make gigglebot turn left and right for a number of milliseconds. How far it turns depends on the freshness of the batteries.", + "gigglebot.turn": "Will make GiggleBot turn left or right until told otherwise (by a stop block or a drive block).", + "gigglebot.turnMillisec": "Will make GiggleBot turn left and right for a number of milliseconds. How far it turns depends on the freshness of the batteries.", "gigglebot.turnMillisec|param|delay": "for how many milliseconds; eg: 1000", "gigglebot.turnMillisec|param|turn_dir": "turning left or right", "gigglebot.voltageShow": "Displays the current battery voltage. Anything lower than 3.4 is too low to run the motors", From 69ae9f14c7bfcd4c891ce74160c55fc9a7f37615 Mon Sep 17 00:00:00 2001 From: CleoQc Date: Sun, 9 Dec 2018 15:12:13 -0500 Subject: [PATCH 13/17] Fix typo --- _locales/fr/gigglebot-jsdoc-strings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_locales/fr/gigglebot-jsdoc-strings.json b/_locales/fr/gigglebot-jsdoc-strings.json index 546ab1f..a2e11cc 100644 --- a/_locales/fr/gigglebot-jsdoc-strings.json +++ b/_locales/fr/gigglebot-jsdoc-strings.json @@ -21,7 +21,7 @@ "gigglebot.lightReadSensor": "Lire le capteur de lumière de gauche ou de droite. \nLes capteurs de lumière sont situés juste en avant des yeux, ils sont tout petits!\nLes valeurs vont de 0 à 1023, en réalité rarement plus que ~950.", "gigglebot.lightReadSensor|param|which": "gauche ou droite", "gigglebot.lineFollow": "Une ligne mince passera entre les deux capteurs et le GiggleBot arrêtera lorsque les deux capteurs détecteront du noir.\nUne large ligne noire sera plus large que la distance entre les deux capteurs. Le GiggleBot arrêtera lorsque les deux capteurs détecteront du blanc.", - "gigglebot.lineFollowStatus": "Vrai lorsque le robot suit une ligne.\r\nFalx autrement.", + "gigglebot.lineFollowStatus": "Vrai lorsque le robot suit une ligne.\r\nFaux autrement.", "gigglebot.lineFollow|param|specific_line_threshold": "modifie la valeur par défaut du seuil de détection d'une ligne pour une meilleure adaptation à l'environnement du GiggleBot.", "gigglebot.lineFollow|param|type_of_line": "ligne large ou mince.", "gigglebot.lineReadSensor": "Lit le capteur de gauche ou de droite.", From cfefcfad5e76bbfa3ea312b954c21e7f9373423e Mon Sep 17 00:00:00 2001 From: CleoQc Date: Sun, 9 Dec 2018 15:19:46 -0500 Subject: [PATCH 14/17] Add servo help text --- _locales/fr/gigglebot-jsdoc-strings.json | 3 +++ _locales/gigglebot-jsdoc-strings.json | 3 +++ 2 files changed, 6 insertions(+) diff --git a/_locales/fr/gigglebot-jsdoc-strings.json b/_locales/fr/gigglebot-jsdoc-strings.json index a2e11cc..a12b151 100644 --- a/_locales/fr/gigglebot-jsdoc-strings.json +++ b/_locales/fr/gigglebot-jsdoc-strings.json @@ -32,6 +32,9 @@ "gigglebot.motorPowerAssignBoth": "Assigne de nouvelles puissances potentiellement différentes aux deux moteurs en un seul bloc. \nValues from 101 through 127, and -128 through -101 are used to float the motor.\n@param left_power: la puissance du moteur de gauche (entre -100 et 100)\n@param right_power: la puissance du moteur de droite (entre -100 et 100)", "gigglebot.motorTrimSet": "Permet de corriger les moteurs lorsque le GiggleBot ne se déplace pas en ligne droite.\r\n@param dir: si le GiggleBot dévie vers la gauche, corriger vers la droite ou vice versa. \r\n@param trim_value: une valeur de correction entre 0 et 100, probablement en deça de 10", "gigglebot.rightPower": "la valeur courante de la puissance du moteur de droite", + "gigglebot.servoMove": "Positionne un servomoteur à une position précise spéficiée en degrés", + "gigglebot.servoMove|param|degree": "quelle position, de 0 à 180 degrés", + "gigglebot.servoMove|param|which": "servomoteur de gauche ou de droite", "gigglebot.setLeftPower": "Assigne une puissance au moteur de gauche\nLes valeurs possibles vont de 101 à 127, et les valeurs de -128 à -101 sont utilisés pour laisser le moteur aller sur son élan.\n@param motor: moteur de gauche ou de droite, ou les deux\n@param power: une valeur entre -100 et 100", "gigglebot.setLeftPower|param|leftpower": "nouvelle valeur de la puissance du moteur de gauche (-100 < leftpower < 100). Les valeurs de 101 à 127 ou de -128 à -101 privent le moteur de sa puissance.", "gigglebot.setLineFollowerThreshold": "Une méthode purement Javascript permettant de changer le seuil de réponse du détecteur de ligne.", diff --git a/_locales/gigglebot-jsdoc-strings.json b/_locales/gigglebot-jsdoc-strings.json index b753114..5abf19b 100644 --- a/_locales/gigglebot-jsdoc-strings.json +++ b/_locales/gigglebot-jsdoc-strings.json @@ -32,6 +32,9 @@ "gigglebot.motorPowerAssignBoth": "Assigns potentially different powers to both motors in one call. \r\nValues from 101 through 127, and -128 through -101 are used to float the motor.\r\n@param left_power: the power to assign to the left motor (between -100 and 100)\r\n@param right_power: the power to assign to the right motor (between -100 and 100)", "gigglebot.motorTrimSet": "This allows the user to correct the motors on the GiggleBot if it's not driving straight\r\n@param dir: if the GiggleBot drives to the left, then correct to the right. Vice versa. \r\n@param trim_value: a correction value between 0 and 100, but most likely below 10", "gigglebot.rightPower": "return current power setting of the right motor", + "gigglebot.servoMove": "Positions a servo motor to a specified position", + "gigglebot.servoMove|param|degree": "which position, from 0 to 180", + "gigglebot.servoMove|param|which": "left or right servo", "gigglebot.setLeftPower": "Assigns a new power value to the left motor\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.", "gigglebot.setLeftPower|param|leftpower": "new value for the power setting of the left motor (-100 < leftpower < 100)", "gigglebot.setLineFollowerThreshold": "A javascript method to change the line follower threshold. \r\nNot exposed as a block", From 9d7a0011b46398d6d019a4a65ea56fd56a590ce8 Mon Sep 17 00:00:00 2001 From: CleoQc Date: Sun, 9 Dec 2018 15:23:08 -0500 Subject: [PATCH 15/17] document servo block. Fix GiggleBot spelling --- gigglebot.ts | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/gigglebot.ts b/gigglebot.ts index 8426d39..95962f9 100644 --- a/gigglebot.ts +++ b/gigglebot.ts @@ -226,7 +226,7 @@ namespace gigglebot { /////////////////////////////////////////////////////////////////////// /** - * Will let gigglebot move forward or backward for a number of milliseconds. + * Will let GiggleBot move forward or backward for a number of milliseconds. * Distance covered during that time is related to the freshness of the batteries. * @param dir forward or backward; * @param delay for how many milliseconds; eg: 1000 @@ -242,7 +242,7 @@ namespace gigglebot { } /** - * Will make gigglebot turn left and right for a number of milliseconds. How far it turns depends on the freshness of the batteries. + * Will make GiggleBot turn left and right for a number of milliseconds. How far it turns depends on the freshness of the batteries. * @param turn_dir turning left or right * @param delay for how many milliseconds; eg: 1000 */ @@ -257,7 +257,7 @@ namespace gigglebot { } /** - * Gigglebot will spin on itself for the provided number of milliseconds, like a turn but staying in the same spot. Especially useful when drawing + * GiggleBot will spin on itself for the provided number of milliseconds, like a turn but staying in the same spot. Especially useful when drawing * @param turn_dir turning left or right * @param delay how many milliseconds; eg: 1000 */ @@ -272,7 +272,7 @@ namespace gigglebot { } /** - * Gigglebot will drive forward while steering to one side for the provided number of milliseconds. + * GiggleBot will drive forward while steering to one side for the provided number of milliseconds. * Useful when it needs to go around an obstacle, or orbit around an object. * 0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block. * @param percent the variation in power between left and right; eg: 0, 20, 50, 100 @@ -292,7 +292,7 @@ namespace gigglebot { } /** - * Will let gigglebot move forward or backward until told otherwise (either by a stop block or a turn block). + * Will let GiggleBot move forward or backward until told otherwise (either by a stop block or a turn block). * @param dir forward or backward */ //% blockId="gigglebot_drive_straight" block="drive %dir" @@ -309,7 +309,7 @@ namespace gigglebot { } /** - * Will make gigglebot turn left or right until told otherwise (by a stop block or a drive block). + * Will make GiggleBot turn left or right until told otherwise (by a stop block or a drive block). */ //% blockId="gigglebotTurn" block="turn %turn_dir" //% weight=88 @@ -323,7 +323,7 @@ namespace gigglebot { } /** - * Gigglebot will spin on itself until told otherwise, like a turn but staying in the same spot. Especially useful when drawing. + * GiggleBot will spin on itself until told otherwise, like a turn but staying in the same spot. Especially useful when drawing. * @param turn_dir left or right; */ //% blockId="gigglebotSpin" block="spin %turn_dir" @@ -338,7 +338,7 @@ namespace gigglebot { } /** - * Gigglebot will drive forward while steering to one side. + * GiggleBot will drive forward while steering to one side. * Useful when it needs to go around an obstacle, or orbit around an object. * 0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block. * @param percent value between 0 and 100 to control the amount of steering @@ -420,8 +420,8 @@ namespace gigglebot { } /** - * A thin black line would fall between the two sensors. The gigglebot will stop when both sensors are reading black. - * A thick black line would have the two sensors on top of it at all times. The gigglebot will stop when both sensors are reading white. + * A thin black line would fall between the two sensors. The GiggleBot will stop when both sensors are reading black. + * A thick black line would have the two sensors on top of it at all times. The GiggleBot will stop when both sensors are reading white. * Calling this block puts the GiggleBot into "Line Follower Mode". To exit "Line Follower Mode" you need to call the "stop following line" block. * @param type_of_line thin line or thick line * @param specific_line_threshold overwrite the default line threshold to adapt to your particular tape and lighting condition. @@ -495,7 +495,7 @@ namespace gigglebot { /** * Will follow a spotlight shone on its eyes. * @param mode either follow or avoid light - * @param sensitivity how much of a difference between the two sides is needed for Gigglebot to react; eg: 20 + * @param sensitivity how much of a difference between the two sides is needed for GiggleBot to react; eg: 20 * @param light_threshold how much light is needed to consider the loop needs to end. This can happen when a light following robot is covered with a box; eg: 10 */ //% blockId="gigglebot_follow_light" block="follow light" @@ -643,6 +643,11 @@ namespace gigglebot { /////////// SERVO BLOCKS + /** + * Positions a servo motor to a specified position + * @param which left or right servo + * @param degree which position, from 0 to 180 + */ //% blockId="gigglebot_servo" block="set %which|servo to |%degree" //% group=Servo //% degree.min=0 degree.max=180 @@ -669,8 +674,8 @@ namespace gigglebot { /** - * This allows the user to correct the motors on the Gigglebot if it's not driving straight - * @param dir: if the gigglebot drives to the left, then correct to the right. Vice versa. + * This allows the user to correct the motors on the GiggleBot if it's not driving straight + * @param dir: if the GiggleBot drives to the left, then correct to the right. Vice versa. * @param trim_value: a correction value between 0 and 100, but most likely below 10 */ //% blockId="gigglebot_trim" block="correct towards %dir|by %trim_value" From 4fc3d05fe9d22692780d22c8e16b6653da258caf Mon Sep 17 00:00:00 2001 From: CleoQc Date: Sun, 9 Dec 2018 15:44:38 -0500 Subject: [PATCH 16/17] 2 spaces as per pxt standards --- _locales/gigglebot-jsdoc-strings.json | 120 +++++++++++------------ _locales/gigglebot-strings.json | 132 +++++++++++++------------- 2 files changed, 126 insertions(+), 126 deletions(-) diff --git a/_locales/gigglebot-jsdoc-strings.json b/_locales/gigglebot-jsdoc-strings.json index 5abf19b..b397ef7 100644 --- a/_locales/gigglebot-jsdoc-strings.json +++ b/_locales/gigglebot-jsdoc-strings.json @@ -1,61 +1,61 @@ { - "gigglebot": "Custom blocks", - "gigglebot.distanceSensorReadRangeContinuous": "Get a reading of how far an obstacle is from the distanse sensor.", - "gigglebot.distanceSensorReadRangeSingle": "Distance Sensor: takes a single reading.", - "gigglebot.distanceSensorTestForObstacle": "Test for the presence of an obstacle.", - "gigglebot.distanceSensorTestForObstacle|param|dist": "how many millimeters; eg: 100", - "gigglebot.distanceSensorTestForObstacle|param|inequality": "less than or more than, closer than or farther than", - "gigglebot.driveMillisec": "Will let GiggleBot move forward or backward for a number of milliseconds.\r\nDistance covered during that time is related to the freshness of the batteries.", - "gigglebot.driveMillisec|param|delay": "for how many milliseconds; eg: 1000", - "gigglebot.driveMillisec|param|dir": "forward or backward; ", - "gigglebot.driveStraight": "Will let GiggleBot move forward or backward until told otherwise (either by a stop block or a turn block).", - "gigglebot.driveStraight|param|dir": "forward or backward", - "gigglebot.gigglebotSpin": "GiggleBot will spin on itself until told otherwise, like a turn but staying in the same spot. Especially useful when drawing.", - "gigglebot.gigglebotSpin|param|turn_dir": "left or right;", - "gigglebot.leftPower": "return current power setting of the left motor", - "gigglebot.lightFollow": "Will follow a spotlight shone on its eyes.", - "gigglebot.lightFollowStatus": "True if robot is currently following light.\r\nFalse otherwise", - "gigglebot.lightFollow|param|light_threshold": "how much light is needed to consider the loop needs to end. This can happen when a light following robot is covered with a box; eg: 10", - "gigglebot.lightFollow|param|mode": "either follow or avoid light", - "gigglebot.lightFollow|param|sensitivity": "how much of a difference between the two sides is needed for GiggleBot to react; eg: 20", - "gigglebot.lightReadSensor": "Reads left or right light sensor. \r\nThe light sensors are placed in front of each eye neopixel, they're tiny! \r\nThe range is 0 through 1023, although in reality rarely above ~950.", - "gigglebot.lightReadSensor|param|which": "left or right", - "gigglebot.lineFollow": "A thin black line would fall between the two sensors. The GiggleBot will stop when both sensors are reading black.\r\nA thick black line would have the two sensors on top of it at all times. The GiggleBot will stop when both sensors are reading white.\r\nCalling this block puts the GiggleBot into \"Line Follower Mode\". To exit \"Line Follower Mode\" you need to call the \"stop following line\" block.", - "gigglebot.lineFollowStatus": "True if robot is currently following a line.\r\nFalse otherwise", - "gigglebot.lineFollow|param|specific_line_threshold": "overwrite the default line threshold to adapt to your particular tape and lighting condition.", - "gigglebot.lineFollow|param|type_of_line": "thin line or thick line", - "gigglebot.lineReadSensor": "Reads left or right line sensor", - "gigglebot.lineReadSensor|param|which": "left or right", - "gigglebot.lineSensorsRaw": "Reads the two line sensors", - "gigglebot.lineTest": "Will return true if the whole line sensor is reading either black or white.\r\n@param color: black or white", - "gigglebot.motorPowerAssign": "Assigns power to a motor, or the same power to both motors\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.\r\n@param motor: left or right motor, or both\r\n@param power: a value between -100 and 100", - "gigglebot.motorPowerAssignBoth": "Assigns potentially different powers to both motors in one call. \r\nValues from 101 through 127, and -128 through -101 are used to float the motor.\r\n@param left_power: the power to assign to the left motor (between -100 and 100)\r\n@param right_power: the power to assign to the right motor (between -100 and 100)", - "gigglebot.motorTrimSet": "This allows the user to correct the motors on the GiggleBot if it's not driving straight\r\n@param dir: if the GiggleBot drives to the left, then correct to the right. Vice versa. \r\n@param trim_value: a correction value between 0 and 100, but most likely below 10", - "gigglebot.rightPower": "return current power setting of the right motor", - "gigglebot.servoMove": "Positions a servo motor to a specified position", - "gigglebot.servoMove|param|degree": "which position, from 0 to 180", - "gigglebot.servoMove|param|which": "left or right servo", - "gigglebot.setLeftPower": "Assigns a new power value to the left motor\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.", - "gigglebot.setLeftPower|param|leftpower": "new value for the power setting of the left motor (-100 < leftpower < 100)", - "gigglebot.setLineFollowerThreshold": "A javascript method to change the line follower threshold. \r\nNot exposed as a block", - "gigglebot.setRightPower": "Assigns a new power value to the right motor\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.", - "gigglebot.setRightPower|param|rightpower": "new value for the power setting of the right motor. (-100 < rightpower < 100)", - "gigglebot.setSpeed": "You can set the speed for each individual motor or both together. The higher the speed the less control the robot has.\r\nYou may need to correct the robot (see block in \"more...\" section). A faster robot needs more correction than a slower one.\r\nNote that any drive correction done previously gets applied here.\r\nIf you want to follow a line, it will work best at a lower speed.\r\nActual speed is dependent on the freshness of the batteries.\r\n@param motor: left, right or both motors\r\n@param speed: how fast the robot goes.", - "gigglebot.spinMillisec": "GiggleBot will spin on itself for the provided number of milliseconds, like a turn but staying in the same spot. Especially useful when drawing", - "gigglebot.spinMillisec|param|delay": "how many milliseconds; eg: 1000", - "gigglebot.spinMillisec|param|turn_dir": "turning left or right", - "gigglebot.steer": "GiggleBot will drive forward while steering to one side. \r\nUseful when it needs to go around an obstacle, or orbit around an object.\r\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", - "gigglebot.steerMillisec": "GiggleBot will drive forward while steering to one side for the provided number of milliseconds. \r\nUseful when it needs to go around an obstacle, or orbit around an object.\r\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", - "gigglebot.steerMillisec|param|delay": "for how many milliseconds; eg: 1000", - "gigglebot.steerMillisec|param|dir": "which direction to steer, left or right", - "gigglebot.steerMillisec|param|percent": "the variation in power between left and right; eg: 0, 20, 50, 100", - "gigglebot.steer|param|dir": "to the left or to the right", - "gigglebot.steer|param|percent": "value between 0 and 100 to control the amount of steering", - "gigglebot.stop": "stops the robot.", - "gigglebot.turn": "Will make GiggleBot turn left or right until told otherwise (by a stop block or a drive block).", - "gigglebot.turnMillisec": "Will make GiggleBot turn left and right for a number of milliseconds. How far it turns depends on the freshness of the batteries.", - "gigglebot.turnMillisec|param|delay": "for how many milliseconds; eg: 1000", - "gigglebot.turnMillisec|param|turn_dir": "turning left or right", - "gigglebot.voltageShow": "Displays the current battery voltage. Anything lower than 3.4 is too low to run the motors", - "gigglebotWhichUniqueMotor": "Use this file to define custom functions and blocks.\r\nRead more at https://makecode.microbit.org/blocks/custom" - } \ No newline at end of file + "gigglebot": "Custom blocks", + "gigglebot.distanceSensorReadRangeContinuous": "Get a reading of how far an obstacle is from the distanse sensor.", + "gigglebot.distanceSensorReadRangeSingle": "Distance Sensor: takes a single reading.", + "gigglebot.distanceSensorTestForObstacle": "Test for the presence of an obstacle.", + "gigglebot.distanceSensorTestForObstacle|param|dist": "how many millimeters; eg: 100", + "gigglebot.distanceSensorTestForObstacle|param|inequality": "less than or more than, closer than or farther than", + "gigglebot.driveMillisec": "Will let GiggleBot move forward or backward for a number of milliseconds.\r\nDistance covered during that time is related to the freshness of the batteries.", + "gigglebot.driveMillisec|param|delay": "for how many milliseconds; eg: 1000", + "gigglebot.driveMillisec|param|dir": "forward or backward; ", + "gigglebot.driveStraight": "Will let GiggleBot move forward or backward until told otherwise (either by a stop block or a turn block).", + "gigglebot.driveStraight|param|dir": "forward or backward", + "gigglebot.gigglebotSpin": "GiggleBot will spin on itself until told otherwise, like a turn but staying in the same spot. Especially useful when drawing.", + "gigglebot.gigglebotSpin|param|turn_dir": "left or right;", + "gigglebot.leftPower": "return current power setting of the left motor", + "gigglebot.lightFollow": "Will follow a spotlight shone on its eyes.", + "gigglebot.lightFollowStatus": "True if robot is currently following light.\r\nFalse otherwise", + "gigglebot.lightFollow|param|light_threshold": "how much light is needed to consider the loop needs to end. This can happen when a light following robot is covered with a box; eg: 10", + "gigglebot.lightFollow|param|mode": "either follow or avoid light", + "gigglebot.lightFollow|param|sensitivity": "how much of a difference between the two sides is needed for GiggleBot to react; eg: 20", + "gigglebot.lightReadSensor": "Reads left or right light sensor. \r\nThe light sensors are placed in front of each eye neopixel, they're tiny! \r\nThe range is 0 through 1023, although in reality rarely above ~950.", + "gigglebot.lightReadSensor|param|which": "left or right", + "gigglebot.lineFollow": "A thin black line would fall between the two sensors. The GiggleBot will stop when both sensors are reading black.\r\nA thick black line would have the two sensors on top of it at all times. The GiggleBot will stop when both sensors are reading white.\r\nCalling this block puts the GiggleBot into \"Line Follower Mode\". To exit \"Line Follower Mode\" you need to call the \"stop following line\" block.", + "gigglebot.lineFollowStatus": "True if robot is currently following a line.\r\nFalse otherwise", + "gigglebot.lineFollow|param|specific_line_threshold": "overwrite the default line threshold to adapt to your particular tape and lighting condition.", + "gigglebot.lineFollow|param|type_of_line": "thin line or thick line", + "gigglebot.lineReadSensor": "Reads left or right line sensor", + "gigglebot.lineReadSensor|param|which": "left or right", + "gigglebot.lineSensorsRaw": "Reads the two line sensors", + "gigglebot.lineTest": "Will return true if the whole line sensor is reading either black or white.\r\n@param color: black or white", + "gigglebot.motorPowerAssign": "Assigns power to a motor, or the same power to both motors\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.\r\n@param motor: left or right motor, or both\r\n@param power: a value between -100 and 100", + "gigglebot.motorPowerAssignBoth": "Assigns potentially different powers to both motors in one call. \r\nValues from 101 through 127, and -128 through -101 are used to float the motor.\r\n@param left_power: the power to assign to the left motor (between -100 and 100)\r\n@param right_power: the power to assign to the right motor (between -100 and 100)", + "gigglebot.motorTrimSet": "This allows the user to correct the motors on the GiggleBot if it's not driving straight\r\n@param dir: if the GiggleBot drives to the left, then correct to the right. Vice versa. \r\n@param trim_value: a correction value between 0 and 100, but most likely below 10", + "gigglebot.rightPower": "return current power setting of the right motor", + "gigglebot.servoMove": "Positions a servo motor to a specified position", + "gigglebot.servoMove|param|degree": "which position, from 0 to 180", + "gigglebot.servoMove|param|which": "left or right servo", + "gigglebot.setLeftPower": "Assigns a new power value to the left motor\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.", + "gigglebot.setLeftPower|param|leftpower": "new value for the power setting of the left motor (-100 < leftpower < 100)", + "gigglebot.setLineFollowerThreshold": "A javascript method to change the line follower threshold. \r\nNot exposed as a block", + "gigglebot.setRightPower": "Assigns a new power value to the right motor\r\nValues from 101 through 127, and -128 through -101 are used to float the motor.", + "gigglebot.setRightPower|param|rightpower": "new value for the power setting of the right motor. (-100 < rightpower < 100)", + "gigglebot.setSpeed": "You can set the speed for each individual motor or both together. The higher the speed the less control the robot has.\r\nYou may need to correct the robot (see block in \"more...\" section). A faster robot needs more correction than a slower one.\r\nNote that any drive correction done previously gets applied here.\r\nIf you want to follow a line, it will work best at a lower speed.\r\nActual speed is dependent on the freshness of the batteries.\r\n@param motor: left, right or both motors\r\n@param speed: how fast the robot goes.", + "gigglebot.spinMillisec": "GiggleBot will spin on itself for the provided number of milliseconds, like a turn but staying in the same spot. Especially useful when drawing", + "gigglebot.spinMillisec|param|delay": "how many milliseconds; eg: 1000", + "gigglebot.spinMillisec|param|turn_dir": "turning left or right", + "gigglebot.steer": "GiggleBot will drive forward while steering to one side. \r\nUseful when it needs to go around an obstacle, or orbit around an object.\r\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", + "gigglebot.steerMillisec": "GiggleBot will drive forward while steering to one side for the provided number of milliseconds. \r\nUseful when it needs to go around an obstacle, or orbit around an object.\r\n0% means no steering, the same as the 'drive' block. 100% is the same as the 'turn' block.", + "gigglebot.steerMillisec|param|delay": "for how many milliseconds; eg: 1000", + "gigglebot.steerMillisec|param|dir": "which direction to steer, left or right", + "gigglebot.steerMillisec|param|percent": "the variation in power between left and right; eg: 0, 20, 50, 100", + "gigglebot.steer|param|dir": "to the left or to the right", + "gigglebot.steer|param|percent": "value between 0 and 100 to control the amount of steering", + "gigglebot.stop": "stops the robot.", + "gigglebot.turn": "Will make GiggleBot turn left or right until told otherwise (by a stop block or a drive block).", + "gigglebot.turnMillisec": "Will make GiggleBot turn left and right for a number of milliseconds. How far it turns depends on the freshness of the batteries.", + "gigglebot.turnMillisec|param|delay": "for how many milliseconds; eg: 1000", + "gigglebot.turnMillisec|param|turn_dir": "turning left or right", + "gigglebot.voltageShow": "Displays the current battery voltage. Anything lower than 3.4 is too low to run the motors", + "gigglebotWhichUniqueMotor": "Use this file to define custom functions and blocks.\r\nRead more at https://makecode.microbit.org/blocks/custom" +} \ No newline at end of file diff --git a/_locales/gigglebot-strings.json b/_locales/gigglebot-strings.json index 5de1e73..01ebba2 100644 --- a/_locales/gigglebot-strings.json +++ b/_locales/gigglebot-strings.json @@ -1,67 +1,67 @@ { - "gigglebot.distanceSensorReadRangeContinuous|block": "distance to obstacle (mm)", - "gigglebot.distanceSensorTestForObstacle|block": "obstacle is %inequality| %dist| mm", - "gigglebot.driveMillisec|block": "drive %dir|for %delay|ms", - "gigglebot.driveStraight|block": "drive %dir", - "gigglebot.firmwareVersion|block": "firmware version number", - "gigglebot.gigglebotSpin|block": "spin %turn_dir", - "gigglebot.lightFollowStatus|block": "following light", - "gigglebot.lightFollow|block": "follow light", - "gigglebot.lightReadSensor|block": "%which|light sensor", - "gigglebot.lightSensorsRaw|block": "raw light sensors (x2)", - "gigglebot.lineFollowStatus|block": "following line", - "gigglebot.lineFollow|block": "follow a %type_of_line| black line", - "gigglebot.lineReadSensor|block": "%which|line sensor", - "gigglebot.lineSensorsRaw|block": "raw line sensors (x2)", - "gigglebot.lineTest|block": "%which|line is detected", - "gigglebot.motorPowerAssignBoth|block": "set left power to %left_power|and right to | %right_power", - "gigglebot.motorPowerAssign|block": "set power on %motor| to | %power", - "gigglebot.motorTrimSet|block": "correct towards %dir|by %trim_value", - "gigglebot.servoMove|block": "set %which|servo to |%degree", - "gigglebot.setSpeed|block": "set %motor | speed to %speed", - "gigglebot.spinMillisec|block": "spin %turn_dir|for %delay|ms", - "gigglebot.steerMillisec|block": "steer %percent| towards the %dir| for %delay| ms", - "gigglebot.steer|block": "steer %percent| towards the %dir", - "gigglebot.stop|block": "stop", - "gigglebot.turnMillisec|block": "turn %turn_dir|for %delay|ms", - "gigglebot.turn|block": "turn %turn_dir", - "gigglebot.voltageBattery|block": "battery voltage (mv)", - "gigglebot.voltageShow|block": "show battery voltage (mv)", - "gigglebotInequality.Closer|block": "closer than", - "gigglebotInequality.Farther|block": "farther than", - "gigglebotLightFollowMode.Avoid|block": "avoid", - "gigglebotLightFollowMode.Follow|block": "follow", - "gigglebotLineColor.Black|block": "black", - "gigglebotLineColor.White|block": "white", - "gigglebotLineType.Thick|block": "thick", - "gigglebotLineType.Thin|block": "thin", - "gigglebotServoAction.Both|block": "both in synchro", - "gigglebotServoAction.Left|block": "left", - "gigglebotServoAction.Mirror|block": "both in mirror", - "gigglebotServoAction.Right|block": "right", - "gigglebotWhichDriveDirection.Backward|block": "backward", - "gigglebotWhichDriveDirection.Forward|block": "forward", - "gigglebotWhichMotor.Both|block": "both motors", - "gigglebotWhichMotor.Left|block": "left motor", - "gigglebotWhichMotor.Right|block": "right motor", - "gigglebotWhichSpeed.Faster|block": "faster", - "gigglebotWhichSpeed.Fastest|block": "fastest", - "gigglebotWhichSpeed.Normal|block": "normal", - "gigglebotWhichSpeed.Slower|block": "slower", - "gigglebotWhichSpeed.Slowest|block": "slowest", - "gigglebotWhichTurnDirection.Left|block": "left", - "gigglebotWhichTurnDirection.Right|block": "right", - "gigglebotWhichUniqueMotor.Left|block": "left motor", - "gigglebotWhichUniqueMotor.Right|block": "right motor", - "gigglebotWhichUnitSystem.inches|block": "inches", - "gigglebotWhichUnitSystem.mm|block": "mm", - "gigglebot|block": "giggleBot", - "{id:category}Gigglebot": "GiggleBot", - "{id:group}DistanceSensor": "DistanceSensor", - "{id:group}Firmware": "Firmware", - "{id:group}LightSensors": "LightSensors", - "{id:group}LineFollower": "LineFollower", - "{id:group}OnBoardSensors": "OnBoardSensors", - "{id:group}Servo": "Servo", - "{id:group}Voltage": "Voltage" - } \ No newline at end of file + "gigglebot.distanceSensorReadRangeContinuous|block": "distance to obstacle (mm)", + "gigglebot.distanceSensorTestForObstacle|block": "obstacle is %inequality| %dist| mm", + "gigglebot.driveMillisec|block": "drive %dir|for %delay|ms", + "gigglebot.driveStraight|block": "drive %dir", + "gigglebot.firmwareVersion|block": "firmware version number", + "gigglebot.gigglebotSpin|block": "spin %turn_dir", + "gigglebot.lightFollowStatus|block": "following light", + "gigglebot.lightFollow|block": "follow light", + "gigglebot.lightReadSensor|block": "%which|light sensor", + "gigglebot.lightSensorsRaw|block": "raw light sensors (x2)", + "gigglebot.lineFollowStatus|block": "following line", + "gigglebot.lineFollow|block": "follow a %type_of_line| black line", + "gigglebot.lineReadSensor|block": "%which|line sensor", + "gigglebot.lineSensorsRaw|block": "raw line sensors (x2)", + "gigglebot.lineTest|block": "%which|line is detected", + "gigglebot.motorPowerAssignBoth|block": "set left power to %left_power|and right to | %right_power", + "gigglebot.motorPowerAssign|block": "set power on %motor| to | %power", + "gigglebot.motorTrimSet|block": "correct towards %dir|by %trim_value", + "gigglebot.servoMove|block": "set %which|servo to |%degree", + "gigglebot.setSpeed|block": "set %motor | speed to %speed", + "gigglebot.spinMillisec|block": "spin %turn_dir|for %delay|ms", + "gigglebot.steerMillisec|block": "steer %percent| towards the %dir| for %delay| ms", + "gigglebot.steer|block": "steer %percent| towards the %dir", + "gigglebot.stop|block": "stop", + "gigglebot.turnMillisec|block": "turn %turn_dir|for %delay|ms", + "gigglebot.turn|block": "turn %turn_dir", + "gigglebot.voltageBattery|block": "battery voltage (mv)", + "gigglebot.voltageShow|block": "show battery voltage (mv)", + "gigglebotInequality.Closer|block": "closer than", + "gigglebotInequality.Farther|block": "farther than", + "gigglebotLightFollowMode.Avoid|block": "avoid", + "gigglebotLightFollowMode.Follow|block": "follow", + "gigglebotLineColor.Black|block": "black", + "gigglebotLineColor.White|block": "white", + "gigglebotLineType.Thick|block": "thick", + "gigglebotLineType.Thin|block": "thin", + "gigglebotServoAction.Both|block": "both in synchro", + "gigglebotServoAction.Left|block": "left", + "gigglebotServoAction.Mirror|block": "both in mirror", + "gigglebotServoAction.Right|block": "right", + "gigglebotWhichDriveDirection.Backward|block": "backward", + "gigglebotWhichDriveDirection.Forward|block": "forward", + "gigglebotWhichMotor.Both|block": "both motors", + "gigglebotWhichMotor.Left|block": "left motor", + "gigglebotWhichMotor.Right|block": "right motor", + "gigglebotWhichSpeed.Faster|block": "faster", + "gigglebotWhichSpeed.Fastest|block": "fastest", + "gigglebotWhichSpeed.Normal|block": "normal", + "gigglebotWhichSpeed.Slower|block": "slower", + "gigglebotWhichSpeed.Slowest|block": "slowest", + "gigglebotWhichTurnDirection.Left|block": "left", + "gigglebotWhichTurnDirection.Right|block": "right", + "gigglebotWhichUniqueMotor.Left|block": "left motor", + "gigglebotWhichUniqueMotor.Right|block": "right motor", + "gigglebotWhichUnitSystem.inches|block": "inches", + "gigglebotWhichUnitSystem.mm|block": "mm", + "gigglebot|block": "GiggleBot", + "{id:category}Gigglebot": "GiggleBot", + "{id:group}DistanceSensor": "DistanceSensor", + "{id:group}Firmware": "Firmware", + "{id:group}LightSensors": "LightSensors", + "{id:group}LineFollower": "LineFollower", + "{id:group}OnBoardSensors": "OnBoardSensors", + "{id:group}Servo": "Servo", + "{id:group}Voltage": "Voltage" +} \ No newline at end of file From 80b1b653889d58e7647572abe97a6bed38dff0e5 Mon Sep 17 00:00:00 2001 From: CleoQc Date: Mon, 10 Dec 2018 09:33:40 -0500 Subject: [PATCH 17/17] fix lightFollow description --- gigglebot.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gigglebot.ts b/gigglebot.ts index 95962f9..66fd737 100644 --- a/gigglebot.ts +++ b/gigglebot.ts @@ -496,7 +496,7 @@ namespace gigglebot { * Will follow a spotlight shone on its eyes. * @param mode either follow or avoid light * @param sensitivity how much of a difference between the two sides is needed for GiggleBot to react; eg: 20 - * @param light_threshold how much light is needed to consider the loop needs to end. This can happen when a light following robot is covered with a box; eg: 10 + * @param light_threshold how much light is needed to exit the loop. This can happen when a light following robot is covered with a box; eg: 10 */ //% blockId="gigglebot_follow_light" block="follow light" //% group=LightSensors