I/O: Make delay(), delayMicroseconds() public

Those mirror Arduino's API, and should come in handy when waiting for very short intervals between I/O operations.
This commit is contained in:
gohai
2015-10-14 15:15:04 +02:00
parent 5575b774b8
commit b80f6211e9
@@ -165,7 +165,7 @@ public class GPIO {
* the sketch is going to achieve.
* @param ms milliseconds to pause
*/
protected static void delay(int ms) {
public static void delay(int ms) {
try {
Thread.sleep(ms);
} catch (InterruptedException e) {
@@ -196,7 +196,7 @@ public class GPIO {
* you might be disappointed.
* @param us microseconds to pause
*/
protected static void delayMicroseconds(int us) {
public static void delayMicroseconds(int us) {
int ms = (int)(us / 1000);
int ns = (us - (ms * 1000)) * 1000;
try {