いわゆる busy wait を使う場合

何もしないループのこと。

#include "MicroBit.h"
MicroBit uBit;
volatile int i;
int n = 20;

int main(void){
    uBit.init();
    for(;;){
        uBit.io.P0.setDigitalValue(1);
        for(i = 0; i < n; i++){}
        uBit.io.P0.setDigitalValue(0);
        for(i = 0; i < n; i++){}
    }
    return 0;
}

f:id:ti-nspire:20180514114109p:plain:w400
f:id:ti-nspire:20180514115658p:plain:w400
t = 0.69 n + 4.12 であるので
n = 1.45 t - 5.97