Cannot compile code

This problem has suddenly occurred. Have not had the problem previously. It occurs on all sketches I try to compile, and on 3 Nanos and 1 UNO. Computer tells me all pertinent drivers are installed correctly. All items chosen under "Tools" are correct. Sample wiring layout is : led cathode to 200 Ohm res. to GND led anode to pin D3

See sketch and error report . (I don't understand your instructions on how to use the "Insert code" button, but I tried, unsuccessfully. Can you please help me to understand how to select, copy and post the sketch and error reports using the Insert key, rather than the Copy and Paste mechanics I used here?))

Sketch:

pinMode(3, OUTPUT); //led3

void setup() { // put your setup code here, to run once:

}

void loop() { // put your main code here, to run repeatedly:

digitalWrite(3, HIGH); delay(1000); digitalWrite(3, LOW); delay(1000); }

(End of sketch.)

Error report:

``Arduino: 1.8.0 (Windows 10), Board: "Arduino/Genuino Uno"

readlink C:\Users\papap\OneDrive\Documents\Arduino\test_semi-circ_leds: The system cannot find the file specified.

Error compiling for board Arduino/Genuino Uno.

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

+

[/code]

OneDrive is the problem.

The problem is caused by using the Arduino IDE with files located under the OneDrive folder.

The easiest solution is to not use the Arduino IDE with any files in OneDrive.

In this case it looks like you have your sketchbook located under OneDrive. You can change the location of the sketchbook folder via the Arduino IDE's File > Preferences > Sketchbook Location. Change that setting to any convenient folder on your computer as long as it's not in the OneDrive. The Arduino IDE does not automatically copy the contents of the previous sketchbook folder to the new location so you will need to do this manually.

If you do want to continue using the Arduino IDE with OneDrive, you may be interested to know that the bug has already been fixed in the beta build of the Arduino IDE, which you can download here: http://www.arduino.cc/en/Main/Software#beta but be aware that version of the Arduino IDE is primarily intended only for beta testing so you may have a higher chance of encountering bugs than you would using the production releases of the IDE.

To see details on the problem, steps that are being taken to fix it, and other possible workarounds that will allow you use the Arduino IDE with OneDrive, see: https://github.com/arduino/arduino-builder/issues/254

Thanks for convincing me I am not going mad. I shall try the maneuver you suggested. Thanks for the great response.

I have tried changing the location of the sketchbook folder via the" File>Preferences>Sketchbook Location", but I couldn't work my way through it. I checked out the lengthy discussion on the github.com discussion 254, and concluded the solution to this problem is to install IDE 1.8.5. While installing 1.8.5, I am instructed to uninstall previous version, with the warning that I will lose all the files involved. If that is so, how do I save my previous sketches and reinstall them under IDE 1.8.5?

arteegee: I have tried changing the location of the sketchbook folder via the" File>Preferences>Sketchbook Location", but I couldn't work my way through it.

Well if you explain what difficulty you had I'm sure I could help you. It's really quite simple. You click the "Browse" button on that preference's input field and then select any folder that's not in your OneDrive.

arteegee: I checked out the lengthy discussion on the github.com discussion 254, and concluded the solution to this problem is to install IDE 1.8.5.

You concluded wrong. The problem still occurs with 1.8.5. Multiple workarounds were presented in that discussion, one of which was to install the BETA version of the Arduino IDE. Nowhere was it said that Arduino IDE 1.8.5 would fix the issue.

Your sketch has an error. You can't call the pinMode() function outside of a function. Move that line to INSIDE setup().

pinMode(3, OUTPUT);          //led3

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(3, HIGH);
  delay(1000);
  digitalWrite(3, LOW);
  delay(1000);
}

Yup you should set pinMode() under the setup

From arteegee's cross post:

arteegee: I have been running a conversation on this subject, but have accidentally deleted all the related posts . Problem was resolved that recent Windows 10 updates have placed One Drive in the path of all my sketches, and that is not workable. While trying to remove One Drive from the path, it appears that I have fouled up my whole IDE system. One such example is that when I click File>Sketchbook, the Sketchbook menu is lost. Where do I go from here?

I already explained this:

pert: The Arduino IDE does not automatically copy the contents of the previous sketchbook folder to the new location so you will need to do this manually.

Copy the contents of C:\Users\papap\OneDrive\Documents\Arduino to your new sketchbook folder.