I am relatively new to Arduino and I am trying to code some neo pixels and every time I try to verify my code this error comes up:
Arduino: 1.8.12 (Mac OS X), Board: "Arduino Uno"
loading libs from /Users/erinshankland/Documents/Arduino/libraries: reading dir >/Users/erinshankland/Documents/Arduino/libraries: open >/Users/erinshankland/Documents/Arduino/libraries: operation not permitted
Error compiling for board Arduino Uno.
This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
this is my code:
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define NUMPIXELS 15
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRBW + NEO_KHZ800);
// this constant won't change:
const int btnRed = 2; // the pin that the pushbutton is attached to
const int btnBlue = 3; // the pin that the pushbutton is attached to
const int btnGreen = 4; // the pin that the pushbutton is attached to
const int btnPurple = 5; // the pin that the pushbutton is attached to
void setup() {
randomSeed(analogRead(A0));
// put your setup code here, to run once:
pinMode(btnRed, INPUT);
pinMode(btnBlue, INPUT);
pinMode(btnGreen, INPUT);
pinMode(btnPurple, INPUT);
// initialize the LED as an output:
// initialize serial communication:
Serial.begin(9600);
pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
pixels.clear(); // Set all pixel colors to 'off'
pixels.show();
delay(1000);
}
void loop() {
if (digitalRead(btnRed)==HIGH){
rndRed();
delay(100);
}
if (digitalRead(btnBlue)==HIGH){
rndBlue();
delay(100);
}
if (digitalRead(btnGreen)==HIGH){
rndGreen();
delay(100);
}
if (digitalRead(btnPurple)==HIGH){
rndPurple();
delay(100);
}
}
void rndRed() {
int led = random(0, 15);
pixels.setPixelColor(led, pixels.Color(255, 0, 0,0));
pixels.show(); // Send the updated pixel colors to the hardware.
delay(500);
}
void rndBlue() {
int led = random(0, 9);
pixels.setPixelColor(led, pixels.Color(0, 0, 255,0));
pixels.show(); // Send the updated pixel colors to the hardware.
delay(500);
}
void rndGreen() {
int led = random(0, 9);
pixels.setPixelColor(led, pixels.Color(0, 255, 0,0));
pixels.show(); // Send the updated pixel colors to the hardware.
delay(500);
}
void rndPurple() {
int led = random(0, 9);
pixels.setPixelColor(led, pixels.Color(171, 0, 255, 0));
pixels.show(); // Send the updated pixel colors to the hardware.
delay(500);
}
I am using a new library for the neo pixels but this has been downloaded and updated. Hopefully someone can help me!
1 Answer 1
loading libs from /Users/erinshankland/Documents/Arduino/libraries: reading dir /Users/erinshankland/Documents/Arduino/libraries: open /Users/erinshankland/Documents/Arduino/libraries: operation not permitted
This is not an Arduino problem but an OS problem.
Either your /Users/erinshankland/Documents/Arduino/libraries
is not accessible by your user (check the permissions) or it's not a directory.
You can try, from a terminal:
sudo chown -R erinshankland /Users/erinshankland/Documents/Arduino/libraries
chmod -R 755 /Users/erinshankland/Documents/Arduino/libraries
which will reset ownership and file permissions on the directory and everything underneath it.
If not, then delete your libraries folder (which may in fact be a file, not a folder) and recreate it and repopulate it with your desired libraries.
-
Thank you this worked! looked like it was a problem with my libraries!Erin Shankland– Erin Shankland2020年04月14日 11:03:35 +00:00Commented Apr 14, 2020 at 11:03
Explore related questions
See similar questions with these tags.