Fixes display and fonts (#85)
* change simulator svg * change radio image * Remove google fonts cdn * change color of 'advanced' button * font fix * font fix 2 * display fix * change fullsceen simulator bg * Continuous servo * handle continuous state * adding shims * update rendering for continuous servos * fixing sim * fix sig * typo * fix sim * bump pxt * bump pxt * rerun travis
This commit is contained in:
@ -535,6 +535,7 @@
|
||||
"pins.pulseIn": "Return the duration of a pulse at a pin in microseconds.",
|
||||
"pins.pulseIn|param|name": "the pin which measures the pulse, eg: DigitalPin.P0",
|
||||
"pins.pulseIn|param|value": "the value of the pulse, eg: PulseValue.High",
|
||||
"pins.servoSetContinuous": "Specifies that a continuous servo is connected.",
|
||||
"pins.servoSetPulse": "Configure the IO pin as an analog/pwm output and set a pulse width. The period is 20 ms period and the pulse width is set based on the value given in **microseconds** or `1/1000` milliseconds.",
|
||||
"pins.servoSetPulse|param|micros": "pulse duration in micro seconds, eg:1500",
|
||||
"pins.servoSetPulse|param|name": "pin name",
|
||||
|
@ -258,6 +258,14 @@ namespace pins {
|
||||
PINOP(setServoValue(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies that a continuous servo is connected.
|
||||
*/
|
||||
//%
|
||||
void servoSetContinuous(AnalogPin name, bool value) {
|
||||
// handled in simulator
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the IO pin as an analog/pwm output and set a pulse width. The period is 20 ms period and the pulse width is set based on the value given in **microseconds** or `1/1000` milliseconds.
|
||||
* @param name pin name
|
||||
|
@ -48,6 +48,9 @@ interface PwmOnlyPin extends DigitalInOutPin, AnalogOutPin {
|
||||
|
||||
//% parts=microservo trackArgs=0
|
||||
servoSetPulse(duration: number): void;
|
||||
|
||||
//% parts=microservo tracArgs=0
|
||||
servoSetContinuous(value: boolean): void;
|
||||
}
|
||||
|
||||
//% noRefCounting fixedInstances
|
||||
@ -109,6 +112,10 @@ class MicrobitPin implements AnalogInPin, AnalogOutPin, AnalogInOutPin, PwmOnlyP
|
||||
pins.servoWritePin(this.analogId(), value);
|
||||
}
|
||||
|
||||
servoSetContinuous(value: boolean): void {
|
||||
pins.servoSetContinuous(this.analogId(), value);
|
||||
}
|
||||
|
||||
servoSetPulse(duration: number): void {
|
||||
pins.servoSetPulse(this.analogId(), duration);
|
||||
}
|
||||
|
6
libs/core/shims.d.ts
vendored
6
libs/core/shims.d.ts
vendored
@ -732,6 +732,12 @@ declare namespace pins {
|
||||
//% name.fieldOptions.tooltips="false" name.fieldOptions.width="250" shim=pins::servoWritePin
|
||||
function servoWritePin(name: AnalogPin, value: int32): void;
|
||||
|
||||
/**
|
||||
* Specifies that a continuous servo is connected.
|
||||
*/
|
||||
//% shim=pins::servoSetContinuous
|
||||
function servoSetContinuous(name: AnalogPin, value: boolean): void;
|
||||
|
||||
/**
|
||||
* Configure the IO pin as an analog/pwm output and set a pulse width. The period is 20 ms period and the pulse width is set based on the value given in **microseconds** or `1/1000` milliseconds.
|
||||
* @param name pin name
|
||||
|
Reference in New Issue
Block a user