Hi all,
I am working on a project for a class where we have to use a photon. I am completely new to this area and the world of programming and I am currently at a stand still with my project. What I am trying to do is connect my photon with my google calendar using IFTTT. When an event is coming up my photon will then display “Yes” on the OLED that comes in the maker kit. I believe the problem I am facing is in my code. I am hoping that someone on here can help me with this project. All that I have done is below:
Connection Between Photon and OLED
3V3 => VCC
GND => GND
A3 => D0
A5 => D1
D3 => DC
D4 => CS
D5 => RES
IFTTT Applet
IFTTT seems to be working because I will get notifications on my console.
Code
//libraries included
#include "Adafruit_SSD1306/Adafruit_GFX.h"
#include "Adafruit_SSD1306/Adafruit_SSD1306.h"
//define pins used
#define OLED_DC D3
#define OLED_CS D4
#define OLED_RESET D5
Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS); //define display
void setup()
{
Particle.subscribe("Upcoming_Event10_4", writetoscreen);
//receive from IFTTTT send to function
}
void loop()
{}
void writetoscreen(const char *event, const char *data)
{
if(strcmp(data,"Upcoming_Event10_4")==0)
{ //compare variable and determine meaning
//display settings an upcoming event
Particle.publish("photon_phanatics_com7","Upcoming_Event10_4");
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println("YES");
display.display();
delay(15000);
display.clearDisplay();
} //if upcoming event display yes for 15 seconds
}
In the code above the large bolded text’s have “#” in front of them but I cannot get them to display, again I am new and I apologize.
Thank you for any help, I have been trying to do research on my own to figure this out but I am currently lost and confused.
Andrew