Newer
Older
#include "Arduino.h"
#include "Behaviours.h"
#include "ServoBehaviours.h"
#include "LEDBehaviours.h"
#include <ESP8266WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
#define MQTT_topic "new001"
char* _ssid;
char* _wifi_pass;
char* _id;
char* _server;
int _port;
int _loop_time = 5;
Adafruit_MQTT_Client* _mqtt;
Adafruit_MQTT_Subscribe* _device_subscription;
Adafruit_MQTT_Publish* _announce;
Adafruit_MQTT_Publish* _my_announce;
String _my_announce_channel;
Adafruit_MQTT_Publish* _input;
Adafruit_MQTT_Publish* _my_input;
String _my_input_channel;
WiFiClient* _client;
Dave Murray-Rust
committed
boolean _wifi;
VizBlocks(char* id, char* ssid="VizBlocksNet", char* wifi_pass="VizBlocksAP",
void command_callback(char *data, uint16_t len);
/*
* Add a behaviour to the list of possible behaviours
*/
/*
* This is the main loop. It should be called from within loop() - really
* this function is the only thing you should need to call. It will manage
* it's own delay, so you can call as often as possible.
*/
/*
* Read a command from the serial input and process it
*/
/*
* Read a command from the serial input and process it. It only waits for
* 50ms to allow other behaviours to continue.
*/
/*
* Process a command. This means:
* - split the command name from the arguments
* - call process_command with the separated command and argument string
/*
* Process a command and its arguments. This means:
* - if found, then call that behaviour with the arguments (which are still a single string)
*/
String process_command(String command, String args);
/*
* Function to connect and reconnect as necessary to the MQTT server.
*/
// Should be called in the loop function and it will take care if connecting.
* These behaviours depend on VizBlocks class so they must be included after
#include "ButtonBehaviours.h"
#include "PotentiometerBehaviours.h"
#include "RotaryEncoderBehaviours.h"