Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'mac was not declared in this scope'
- #include <Ethernet.h>
- #include <PubNub.h>
- void setup() {
- /* For debugging, set to speed of your choice */
- Serial.begin(9600);
- /* If you use some other HW, you need to do some other
- initialization of it here... */
- Ethernet.begin();
- /* Start the Pubnub library by giving it a publish and subscribe
- keys */
- PubNub.begin(publisher key, subscriber key);
- }
- void loop() {
- /* Maintain DHCP lease. For other HW, you may need to do
- something else here, or maybe nothing at all. */
- Ethernet.maintain();
- /* Publish message. You could use `auto` here... */
- PubNonSubClient *pclient = PubNub.publish(pubchannel, ""message"");
- if (!pclient) return;
- PublishCracker cheez;
- cheez.read_and_parse(pclient);
- /** You're mostly interested in `outcome()`, and,
- if it's "failed", then `description()`.
- */
- Serial.print("Outcome: "); Serial.print(cheez.outcome());
- Serial.print(' '); Serial.println(cheez.to_str(cheez.outcome()));
- Serial.print("description: "); Serial.println(cheez.description());
- Serial.print("timestamp: "); Serial.println(cheez.timestamp());
- Serial.print("state: "); Serial.print(cheez.state());
- Serial.print(' '); Serial.println(cheez.to_str(cheez.state()));
- pclient->stop();
- /* Wait for news. */
- PubSubClient *sclient = PubNub.subscribe(subchannel);
- if (!sclient) return; // error
- String msg;
- SubscribeCracker ritz(sclient);
- while (!ritz.finished()) {
- ritz.get(msg);
- if (msg.length() > 0) {
- Serial.print("Received: "); Serial.println(msg);
- }
- }
- sclient->stop();
- delay(1000);
- }
- error :-
- sketch_jan17a:28:47: error: 'pubchannel' was not declared in this scope
- PubNonSubClient *pclient = PubNub.publish(pubchannel, ""message"");
- ^
- sketch_jan17a:44:46: error: 'subchannel' was not declared in this scope
- PubSubClient *sclient = PubNub.subscribe(subchannel);
- ^
- Multiple libraries were found for "Ethernet.h"
- Used: C:UserssultanAppDataLocalArduino15packagesesp8266hardwareesp82662.5.0-beta2librariesEthernet
- Not used: C:Program Files (x86)ArduinolibrariesEthernet
- exit status 1
- 'mac' was not declared in this scope
Add Comment
Please, Sign In to add comment