New problems: "In Member function" error and BYTE definition error

Hi everyone,

Some background: I'm using an Arduino Uno R3 with Ubuntu 14.04 and Arduino IDE 1.0.6. I'm constructing the Twitter Mood Light from Instructables.com.

Now, I have two new problems with the code for the Twitter Mood Light that I'm trying to solve. I get two errors, one is an "In Member function" error and the other is a "‘BYTE’ was not declared in this scope" error. Here are the exact details from the console:

/home/raghav/sketchbook/libraries/WiFly/WiFly.cpp: In member function ‘bool WiFly::HttpWebRequest(const char*, const char*, HtmlParser*)’:
/home/raghav/sketchbook/libraries/WiFly/WiFly.cpp:362: error: ‘BYTE’ was not declared in this scope

Now, since I'm a noob, I don't know what an "in member function" is, let alone try to solve this problem. I've looked around the web for solutions but I found nothing. Now I've looked at this WiFly.cpp file and turns out the variable "BYTE" hasn't been defined. But I don't know what I should define this "BYTE" variable as...??

Any thoughts on this are appreciated folks. For any more information, let me know and I can provide it.

Can you provide links to this code? That way we don't have to guess / search.

No problem. Here's the link to the instructables.com project for the Twitter mood light: http://www.instructables.com/id/Twitter-Mood-Light-The-Worlds-Mood-in-a-Box/?ALLSTEPS

Scroll down to the end of step 6 on the webpage and you'll find a zip file called WorldMood.zip. Download this file and extract the folders from it. The WiFly.cpp file can be found in libraries/WiFly.

you can just post file we need...

I tried. But there are too many files. It won't let me add an entire folder for you guys.

Here’s the WiFly.cpp file. On line 362, the keyword “BYTE” is the problem.

WiFly.cpp (16.9 KB)

You can do attachments (of the .zip file). Anyway, I found the .zip file on the site and now:

      m_printer->print(incoming_data,BYTE);

The use of BYTE is deprecated. Change to:

      m_printer->print(incoming_data);

You need to change the include of WProgram.h to:

#include "Arduino.h"

... in all the files in which that occurs. Then it should compile OK.

Also I changed those PROGMEM lines to just:

char PROGMEM string_0[]  = "GET /search.json?q=\"i+love+you\"+OR+\"i+love+her\"+OR+\"i+love+him\"+OR+\"all+my+love\"+OR+\"i'm+in+love\"+OR+\"i+really+love\"&rpp=30&result_type=recent";
char PROGMEM string_1[]  = "GET /search.json?q=\"happiest\"+OR+\"so+happy\"+OR+\"so+excited\"+OR+\"i'm+happy\"+OR+\"woot\"+OR+\"w00t\"&rpp=30&result_type=recent";
char PROGMEM string_2[]  = "GET /search.json?q=\"wow\"+OR+\"O_o\"+OR+\"can't+believe\"+OR+\"wtf\"+OR+\"unbelievable\"&rpp=30&result_type=recent";
char PROGMEM string_3[]  = "GET /search.json?q=\"i+hate\"+OR+\"really+angry\"+OR+\"i+am+mad\"+OR+\"really+hate\"+OR+\"so+angry\"&rpp=30&result_type=recent";
char PROGMEM string_4[]  = "GET /search.json?q=\"i+wish+i\"+OR+\"i'm+envious\"+OR+ \"i'm+jealous\"+OR+\"i+want+to+be\"+OR+\"why+can't+i\"+&rpp=30&result_type=recent";
char PROGMEM string_5[]  = "GET /search.json?q=\"i'm+so+sad\"+OR+\"i'm+heartbroken\"+OR+\"i'm+so+upset\"+OR+\"i'm+depressed\"+OR+\"i+can't+stop+crying\"&rpp=30&result_type=recent";
char PROGMEM string_6[]  = "GET /search.json?q=\"i'm+so+scared\"+OR+\"i'm+really+scared\"+OR+\"i'm+terrified\"+OR+\"i'm+really+afraid\"+OR+\"so+scared+i\"&rpp=30&result_type=recent";

Thanks a lot Nick! It compiled for me as well after the changes you suggested. :)