I have recently brought an ESP 32 WROOM, and ive been watching a video by Drone workshop, i copied his blink sketch from the article Getting Started with the ESP32 - Using the Arduino IDE
when i try to upload it the IDE tells me ledPin was not declared in this scope, however I have been staring at this for nearly 10 minutes and it looks fine to me, ill show a print screen here as it is a very short sketch and you can see all the code in one screenshot.
here is the complete error message:
Arduino: 1.8.12 (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Core 1, Core 1, None"
<command-line>: error: expected unqualified-id before numeric constant
C:\Users\NicholasNG\Documents\Arduino\Classic_bluetooth_ESP_32\Classic_bluetooth_ESP_32.ino:1:3: note: in expansion of macro 'ESP32'
ESP32 Blink
^~~~~
C:\Users\NicholasNG\Documents\Arduino\Classic_bluetooth_ESP_32\Classic_bluetooth_ESP_32.ino: In function 'void setup()':
Classic_bluetooth_ESP_32:16:13: error: 'ledPin' was not declared in this scope
pinMode(ledPin, OUTPUT);
^~~~~~
C:\Users\NicholasNG\Documents\Arduino\Classic_bluetooth_ESP_32\Classic_bluetooth_ESP_32.ino:16:13: note: suggested alternative: 'lldiv'
pinMode(ledPin, OUTPUT);
^~~~~~
lldiv
C:\Users\NicholasNG\Documents\Arduino\Classic_bluetooth_ESP_32\Classic_bluetooth_ESP_32.ino: In function 'void loop()':
Classic_bluetooth_ESP_32:25:18: error: 'ledPin' was not declared in this scope
digitalWrite(ledPin, HIGH);
^~~~~~
C:\Users\NicholasNG\Documents\Arduino\Classic_bluetooth_ESP_32\Classic_bluetooth_ESP_32.ino:25:18: note: suggested alternative: 'lldiv'
digitalWrite(ledPin, HIGH);
^~~~~~
lldiv
exit status 1
'ledPin' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
very odd, under board in tools I use "ESP 32 devmodule" there are also a variety of new setting that appear when using the ESP 32 and ill show an image of my setting here, hopefully its clear.
thanks for the help!