You can use a function called delayMicroseconds().
If switching the pins with digitalWrite() takes too long for what you need, look at direct port manipulation in the playground.
You can use a function called delayMicroseconds().
If switching the pins with digitalWrite() takes too long for what you need, look at direct port manipulation in the playground.