I am currently writing a code to produce a tone on a NodeMCU and I keep getting an error message saying 'PORTD' was not declared in this scope and I cant figure out how to fix it. Here's my code.
void setup(){
pinMode(D3,OUTPUT);
}
void loop(){
playNote(568);
delay(250);
}
void playNote(int noteDelay){
int x;
for(x=0;x<100000/noteDelay;x++){
PORTD |=0x01;
delayMicroseconds(noteDelay);
PORTD &=0xFE;
delayMicroseconds(noteDelay);
}
}