Error: 'byte' does not name a type

In an attempt to create custom characters for the LCD display, several problems popped up:

  1. How to create an header file in the IDE?
    It looks to me like I have to add an new tab (Ctrl+Shft+N), and enter the name of the new file into the fields popping up. The menu Sketch|Add File... seems to make weird things, in an attempt to add an previously created file (NotePad) the IDE erased that file :frowning:

  2. Why is 'byte' not a know type, when I #include the header file into the sketch file?
    Offending line:
    const byte d000[8] = { //... };
    Same error both w/out 'const'. Which type name could be used instead?

  3. How does the compiler allocate constants and variables?
    How do I tell the compiler that my custom character definitions should reside in const arrays in flash memory? Is the 'const' modifier sufficient for that purpose?

What version of the IDE are you using? I've had no problems creating header files. Just make sure they reside in the same directory as the *.ino file. Also, byte has posed no problems for me. I'm using 1.6.

Thanks for the hint, I'm using 1.0.6 and didn't realize the updates.

Unfortunately I cannot download the new version, getting "Access denied" for both Installer and Zip links :frowning:

There are 3 different ways to make multi-file IDE sketches, each with their pro, cons and traps.

The simplest is just to have several .INO files in the same directory, the one created with the same name as your sketch. You can write them in any editor and simply place them there. It does require a restart of the Arduino IDE for it to discover them. If you are in the IDE, then hit the little arrow in the tab-bar (its on the righthand edge, underneth the button bar). You get a menu with "New Tab ..." hit that, and enter a file name. There now you have two windows. When you compile the program the files are simply added together. Because of the way the IDE tries to simplyfy your life with function prototypes behind your back, you may get strange errors if you use #define" or similar in anything but the main INO sketch

The next method involves files with .CPP and .H extension. You must use a #include <name-of-h-file.h> to get it included. The CPP files are compiled seperatly and therefor you need to #include <arduino.h> at the top, so "byte" gets defined (ie solve the error you have). You do not have to have .h and .cpp matched up (but usually ends up being so for convinience)

You do not need to upgrade.

There seems to be a bug in arduino.cc. I cannot download anything, not even older versions, using Firefox or IE, regardless of whether I'm logged in or not. The server, in detail:
http://arduino.cc/download_handler.php?f=/arduino-1.6.0-windows.exe
rejects any download attempt: error code 403 Forbidden :frowning:

You can include Arduino.h or use uint8_t as a data type.

Thanks, including Arduino.h eliminated the error messages :slight_smile:

The server errors also disappeared, the slow download indicates to me a temporary server overload.

The compiler errors didn't disappear with 1.6.0, so that it seems necessary to #include <Arduino.h> into header files.