-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Description
I'm trying to turn on my outputs faster than digitalwrite allows. Is there a way to directly talk to PORTD or some other Arduino like command to make it work?
I tried:
PORTD = B10101000;
but Arduino returned this error
'PORTD' was not declared in this scope
PORTD = B10101000;
edit: I think I figured out my problem. digitalWrite works fast (3.2 microseconds on to off), but delayMicroseconds(1); actually delays 20 microseconds.
Edit again:
void delayCustom(int val){
for(int i=0;i<val;i++){
__NOP();
}
}
Calling that function will delay about 10us (microseconds) passing in 22.
Metadata
Metadata
Assignees
Labels
No labels