Hi,
I am having problems getting this bitcoin api webhook I created to compile.
does anyone see any obvious issues? I appreciate it
I tested the webhook and its working…
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
Serial.begin(9600);
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3C for 128x32
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
// Subscribe to the integration response event
Particle.subscribe("hook-response/bitcoin", myHandler, MY_DEVICES); // webhook instructions
}
void myHandler(const char *event, const char *data) { // webhook instructions
// Handle the integration response
}
void loop() {
bitcoin();
}
void bitcoin(void) {
// Get some data
String data = String(10); // webhook instructions
// Trigger the integration
Particle.publish("bitcoin", data, PRIVATE); // webhook instructions
display.clearDisplay();
display.setTextSize(2); // Draw 2X-scale text
display.setTextColor(WHITE);
display.setCursor(10, 0);
display.myHandler;
//display.display(); // Show initial text
delay(60000); // Wait 60 seconds // webhook instructions
}