simplify feeds in examples
This commit is contained in:
parent
5e46585e25
commit
faad8998f6
@ -46,20 +46,15 @@ Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO
|
|||||||
|
|
||||||
// Setup a feed called 'photocell' for publishing.
|
// Setup a feed called 'photocell' for publishing.
|
||||||
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
|
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
|
||||||
#define PHOTOCELL_FEED AIO_USERNAME "/feeds/photocell"
|
Adafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/photocell");
|
||||||
Adafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, PHOTOCELL_FEED);
|
|
||||||
|
|
||||||
// Setup a feed called 'onoff' for subscribing to changes.
|
// Setup a feed called 'onoff' for subscribing to changes.
|
||||||
#define ONOFF_FEED AIO_USERNAME "/feeds/onoff"
|
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/onoff");
|
||||||
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, ONOFF_FEED);
|
|
||||||
|
|
||||||
/*************************** Error Reporting *********************************/
|
/*************************** Error Reporting *********************************/
|
||||||
|
|
||||||
#define ERROR_FEED AIO_USERNAME "/errors"
|
Adafruit_MQTT_Subscribe errors = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/errors");
|
||||||
Adafruit_MQTT_Subscribe errors = Adafruit_MQTT_Subscribe(&mqtt, ERROR_FEED);
|
Adafruit_MQTT_Subscribe throttle = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/throttle");
|
||||||
|
|
||||||
#define THROTTLE_FEED AIO_USERNAME "/throttle"
|
|
||||||
Adafruit_MQTT_Subscribe throttle = Adafruit_MQTT_Subscribe(&mqtt, THROTTLE_FEED);
|
|
||||||
|
|
||||||
/*************************** Sketch Code ************************************/
|
/*************************** Sketch Code ************************************/
|
||||||
|
|
||||||
|
@ -45,10 +45,9 @@ const char* fingerprint = "26 96 1C 2A 51 07 FD 15 80 96 93 AE F7 32 CE B9 0D 01
|
|||||||
|
|
||||||
/****************************** Feeds ***************************************/
|
/****************************** Feeds ***************************************/
|
||||||
|
|
||||||
// Setup a feed called 'photocell' for publishing.
|
// Setup a feed called 'test' for publishing.
|
||||||
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
|
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
|
||||||
#define TEST_FEED AIO_USERNAME "/feeds/test"
|
Adafruit_MQTT_Publish test = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/test");
|
||||||
Adafruit_MQTT_Publish test = Adafruit_MQTT_Publish(&mqtt, TEST_FEED);
|
|
||||||
|
|
||||||
/*************************** Sketch Code ************************************/
|
/*************************** Sketch Code ************************************/
|
||||||
|
|
||||||
|
@ -49,11 +49,8 @@ Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO
|
|||||||
/****************************** Feeds ***************************************/
|
/****************************** Feeds ***************************************/
|
||||||
|
|
||||||
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
|
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
|
||||||
// Setup a feed called 'onoff' for subscribing to changes.
|
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/onoff");
|
||||||
#define ONOFF_FEED AIO_USERNAME "/feeds/onoff"
|
Adafruit_MQTT_Subscribe slider = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/slider");
|
||||||
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, ONOFF_FEED);
|
|
||||||
#define SLIDER_FEED AIO_USERNAME "/feeds/slider"
|
|
||||||
Adafruit_MQTT_Subscribe slider = Adafruit_MQTT_Subscribe(&mqtt, SLIDER_FEED);
|
|
||||||
|
|
||||||
/*************************** Sketch Code ************************************/
|
/*************************** Sketch Code ************************************/
|
||||||
|
|
||||||
|
@ -59,12 +59,10 @@ boolean CC3000connect(const char* wlan_ssid, const char* wlan_pass, uint8_t wlan
|
|||||||
|
|
||||||
// Setup a feed called 'photocell' for publishing.
|
// Setup a feed called 'photocell' for publishing.
|
||||||
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
|
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
|
||||||
#define PHOTOCELL_FEED AIO_USERNAME "/feeds/photocell"
|
Adafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/photocell");
|
||||||
Adafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, PHOTOCELL_FEED);
|
|
||||||
|
|
||||||
// Setup a feed called 'onoff' for subscribing to changes.
|
// Setup a feed called 'onoff' for subscribing to changes.
|
||||||
#define ONOFF_FEED AIO_USERNAME "/feeds/onoff"
|
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/onoff");
|
||||||
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, ONOFF_FEED);
|
|
||||||
|
|
||||||
/*************************** Sketch Code ************************************/
|
/*************************** Sketch Code ************************************/
|
||||||
|
|
||||||
|
@ -45,12 +45,10 @@ Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO
|
|||||||
|
|
||||||
// Setup a feed called 'photocell' for publishing.
|
// Setup a feed called 'photocell' for publishing.
|
||||||
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
|
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
|
||||||
#define PHOTOCELL_FEED AIO_USERNAME "/feeds/photocell"
|
Adafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/photocell");
|
||||||
Adafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, PHOTOCELL_FEED);
|
|
||||||
|
|
||||||
// Setup a feed called 'onoff' for subscribing to changes.
|
// Setup a feed called 'onoff' for subscribing to changes.
|
||||||
#define ONOFF_FEED AIO_USERNAME "/feeds/onoff"
|
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/onoff");
|
||||||
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, ONOFF_FEED);
|
|
||||||
|
|
||||||
/*************************** Sketch Code ************************************/
|
/*************************** Sketch Code ************************************/
|
||||||
|
|
||||||
|
@ -67,12 +67,10 @@ boolean FONAconnect(const __FlashStringHelper *apn, const __FlashStringHelper *u
|
|||||||
|
|
||||||
// Setup a feed called 'photocell' for publishing.
|
// Setup a feed called 'photocell' for publishing.
|
||||||
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
|
// Notice MQTT paths for AIO follow the form: <username>/feeds/<feedname>
|
||||||
#define PHOTOCELL_FEED AIO_USERNAME "/feeds/photocell"
|
Adafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/photocell");
|
||||||
Adafruit_MQTT_Publish photocell = Adafruit_MQTT_Publish(&mqtt, PHOTOCELL_FEED);
|
|
||||||
|
|
||||||
// Setup a feed called 'onoff' for subscribing to changes.
|
// Setup a feed called 'onoff' for subscribing to changes.
|
||||||
#define ONOFF_FEED AIO_USERNAME "/feeds/onoff"
|
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/onoff");
|
||||||
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, ONOFF_FEED);
|
|
||||||
|
|
||||||
/*************************** Sketch Code ************************************/
|
/*************************** Sketch Code ************************************/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user