Hey guys, I am using Arduino IDE 1.8.16 with no external libraries nor did I put in any extra libraries yet my simple code gave me an error.
Code:
void setup() {
// put your setup code here, to run once:
DDRD = 0x40;
}
void loop() {
// put your main code here, to run repeatedly:
PORTD = 0x40;
delay(1000);
PORTD = 0x00;
delay(1000);
}
The error message :
Arduino: 1.8.16 (Windows 10), Board: "NodeMCU-32S, 80MHz, 921600"
C:\Users\lynn\OneDrive\Documents\Arduino\sketch_oct30a\sketch_oct30a.ino: In function 'void setup()':
sketch_oct30a:3:1: error: 'DDRD' was not declared in this scope
DDRD = 0x40;
^~~~
C:\Users\lynn\OneDrive\Documents\Arduino\sketch_oct30a\sketch_oct30a.ino:3:1: note: suggested alternative: 'DDR'
DDRD = 0x40;
^~~~
DDR
C:\Users\lynn\OneDrive\Documents\Arduino\sketch_oct30a\sketch_oct30a.ino: In function 'void loop()':
sketch_oct30a:8:1: error: 'PORTD' was not declared in this scope
PORTD = 0x40;
^~~~~
C:\Users\lynn\OneDrive\Documents\Arduino\sketch_oct30a\sketch_oct30a.ino:8:1: note: suggested alternative: 'PRID'
PORTD = 0x40;
^~~~~
PRID
exit status 1
'DDRD' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Any ideas on how to fix this?