|
Thread.sleep(0, value*100); |
hi vinicius,
i usually don't use such a small units, but imho there should be multiplier 1000 if you wanna change microseconds to nanoseconds.
usage delayMicroseconds(4500); // wait min 4.1ms
while delayMicroseconds(int value) means Thread.sleep(0, value*100);
gives me sleep for 450,000 nanoseconds which is 450 microseconds which is only 0.45 miliseconds...
correct sleep should be something like
Thread.sleep(value / 1000, (value % 1000) * 1000);
anyway, maybe it's not big deal as it works for me with 100 on rpi 3 just fine. or i'm just missing something ;)
miro (rinkishimo)
things-api/raspberry/Samples/LcdI2C/src/lcd/LiquidCrystal_I2C.java
Line 409 in 1426ac8
hi vinicius,
i usually don't use such a small units, but imho there should be multiplier 1000 if you wanna change microseconds to nanoseconds.
usage delayMicroseconds(4500); // wait min 4.1ms
while delayMicroseconds(int value) means Thread.sleep(0, value*100);
gives me sleep for 450,000 nanoseconds which is 450 microseconds which is only 0.45 miliseconds...
correct sleep should be something like
Thread.sleep(value / 1000, (value % 1000) * 1000);
anyway, maybe it's not big deal as it works for me with 100 on rpi 3 just fine. or i'm just missing something ;)
miro (rinkishimo)