Ejemplo n.º 1
0
/**
 * Configures the PWM period of the analog output to the given value.
 *
 * @param period The new period for the analog output in microseconds.
 * @return MICROBIT_OK on success, or MICROBIT_NOT_SUPPORTED if the
 * given pin is not configured as an analog output.
 */
int MicroBitPin::setAnalogPeriod(int period)
{
    return setAnalogPeriodUs(period*1000);
}
Ejemplo n.º 2
0
 //% help=pins/analog-set-period weight=23 blockGap=8
 //% blockId=device_set_analog_period block="analog set period|pin %pin|to (µs)%micros"
 //% pin.fieldEditor="gridpicker" pin.fieldOptions.columns=4
 //% pin.fieldOptions.tooltips="false"
 void analogSetPeriod(AnalogPin name, int micros) {
     PINOP(setAnalogPeriodUs(micros));
 }