updated docs paths
This commit is contained in:
@ -61,7 +61,7 @@ namespace pins {
|
||||
* Read the specified pin or connector as either 0 or 1
|
||||
* @param name pin to read from
|
||||
*/
|
||||
//% help=functions/digital-read-pin weight=30 shim=micro_bit::digitalReadPin
|
||||
//% help=pins/digital-read-pin weight=30 shim=micro_bit::digitalReadPin
|
||||
//% blockId=device_get_digital_pin block="digital read|pin %name" blockGap=8
|
||||
export function digitalReadPin(name: DigitalPins): number {
|
||||
|
||||
@ -73,7 +73,7 @@ namespace pins {
|
||||
* @param name pin to write to
|
||||
* @param value value to set on the pin, eg: 1,0
|
||||
*/
|
||||
//% help=functions/digital-write-pin weight=29 shim=micro_bit::digitalWritePin
|
||||
//% help=pins/digital-write-pin weight=29 shim=micro_bit::digitalWritePin
|
||||
//% blockId=device_set_digital_pin block="digital write|pin %name|to %value"
|
||||
export function digitalWritePin(name: DigitalPins, value: number): void { }
|
||||
|
||||
@ -81,7 +81,7 @@ namespace pins {
|
||||
* Read the connector value as analog, that is, as a value comprised between 0 and 1023.
|
||||
* @param name pin to write to
|
||||
*/
|
||||
//% help=functions/analog-read-pin weight=25 shim=micro_bit::analogReadPin
|
||||
//% help=pins/analog-read-pin weight=25 shim=micro_bit::analogReadPin
|
||||
//% blockId=device_get_analog_pin block="analog read|pin %name" blockGap="8"
|
||||
export function analogReadPin(name: AnalogPins): number {
|
||||
return 0;
|
||||
@ -92,7 +92,7 @@ namespace pins {
|
||||
* @param name pin name to write to
|
||||
* @param value value to write to the pin between ``0`` and ``1023``. eg:1023,0
|
||||
*/
|
||||
//% help=functions/analog-write-pin weight=24 shim=micro_bit::analogWritePin
|
||||
//% help=pins/analog-write-pin weight=24 shim=micro_bit::analogWritePin
|
||||
//% blockId=device_set_analog_pin block="analog write|pin %name|to %value" blockGap=8
|
||||
export function analogWritePin(name: AnalogPins, value: number): void { }
|
||||
|
||||
@ -102,7 +102,7 @@ namespace pins {
|
||||
* @param pin analog pin to set period to
|
||||
* @param micros period in micro seconds. eg:20000
|
||||
*/
|
||||
//% shim=micro_bit::setAnalogPeriodUs help=functions/analog-set-period weight=23
|
||||
//% shim=micro_bit::setAnalogPeriodUs help=pins/analog-set-period weight=23
|
||||
//% blockId=device_set_analog_period block="analog set period|pin %pin|to (µs)%micros"
|
||||
export function analogSetPeriod(pin: AnalogPins, micros: number): void { }
|
||||
|
||||
@ -111,7 +111,7 @@ namespace pins {
|
||||
* @param name pin to write to
|
||||
* @param value angle or rotation speed, eg:180,90,0
|
||||
*/
|
||||
//% help=functions/servo-write-pin weight=20 shim=micro_bit::servoWritePin
|
||||
//% help=pins/servo-write-pin weight=20 shim=micro_bit::servoWritePin
|
||||
//% blockId=device_set_servo_pin block="servo write|pin %name|to %value" blockGap=8
|
||||
export function servoWritePin(name: AnalogPins, value: number): void { }
|
||||
|
||||
@ -120,7 +120,7 @@ namespace pins {
|
||||
* @param pin pin name
|
||||
* @param micros pulse duration in micro seconds, eg:1500
|
||||
*/
|
||||
//% shim=micro_bit::setServoPulseUs help=functions/serial-set-pulse weight=19
|
||||
//% shim=micro_bit::setServoPulseUs help=pins/serial-set-pulse weight=19
|
||||
//% blockId=device_set_servo_pulse block="servo set pulse|pin %value|to (µs) %micros"
|
||||
export function servoSetPulse(pin: AnalogPins, micros: number): void { }
|
||||
|
||||
@ -132,7 +132,7 @@ namespace pins {
|
||||
* @param toLow the lower bound of the value's target range
|
||||
* @param toHigh the upper bound of the value's target range, eg: 4
|
||||
*/
|
||||
//% help=functions/map weight=15
|
||||
//% help=pins/map weight=15
|
||||
//% blockId=math_map block="map %value|from low %fromLow|from high %fromHigh|to low %toLow|to high %toHigh"
|
||||
export function map(value: number, fromLow: number, fromHigh: number, toLow: number, toHigh: number): number {
|
||||
return ((value - fromLow) * (toHigh - toLow)) / (fromHigh - fromLow) + toLow;
|
||||
@ -142,7 +142,7 @@ namespace pins {
|
||||
* Sets the pin used when using `pins->analog pitch`.
|
||||
* @param name TODO
|
||||
*/
|
||||
//% shim=micro_bit::enablePitch help=functions/analog-set-pitch weight=12
|
||||
//% shim=micro_bit::enablePitch help=pins/analog-set-pitch weight=12
|
||||
export function analogSetPitchPin(name: AnalogPins): void { }
|
||||
|
||||
/**
|
||||
@ -150,6 +150,6 @@ namespace pins {
|
||||
* @param frequency TODO
|
||||
* @param ms TODO
|
||||
*/
|
||||
//% shim=micro_bit::pitch help=functions/analog-pitch weight=14 async
|
||||
//% shim=micro_bit::pitch help=pins/analog-pitch weight=14 async
|
||||
export function analogPitch(frequency: number, ms: number): void { }
|
||||
}
|
||||
|
Reference in New Issue
Block a user