I am using the WEB IDE to compile a new project using the “SparkFunMicroOLED.h” library. However when i compile the program i get “SparkFunMicroOLED.h: No such file or directory”
This sometimes happens.
Can you just try changing #include <SparkFunMicroOLED.h>
?
It also helps if you show us your code, which device, and what version of system firmware you’re compiling against.
I am using a Photon with Firmware Version 7
I have changed quotes to <> but this still brings up the same error
test code below
// ------------
// Blink an LED
// ------------
#include "SparkFunMicroOLED.h"
int led1 = D0; // Instead of writing D0 over and over again, we'll write led1
// You'll need to wire an LED to this one to see it blink.
int led2 = D7; // Instead of writing D7 over and over again, we'll write led2
// This one is the little blue LED on your board. On the Photon it is next to D7, and on the Core it is next to the USB jack.
void setup() {
// We are going to tell our device that D0 and D7 (which we named led1 and led2 respectively) are going to be output
// (That means that we will be sending voltage to them, rather than monitoring voltage that comes from them)
// It's important you do this here, inside the setup() function rather than outside it or in the loop function.
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
}
void loop() {
// To blink the LED, first we'll turn it on...
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
// We'll leave it on for 1 second...
delay(1000);
// Then we'll turn it off...
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
// Wait 1 second...
delay(1000);
// And repeat!
}
@PaulM2 did you attach the library to your project? Adding the #include is not enough.
2 Likes
Hi Peekay123
Many thanks. I didn’t attach the library (oops - New to this environment) so I have now and this works now. I had the same problem with another app using this library and the MQTT library. I reattached the MQTT library and this now works
Many Thanks
1 Like