Pages: [1]   Go Down
Author Topic: [SOLVED]Array error: 'byte' does not name a type  (Read 1500 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there.
I'm trying to build a POV writer, and am having some trouble with one of my header files.
The file in question is called font.h and looks like:
Code:
const byte font[][5] = {
            {0x00,0x00,0x00,0x00,0x00},   //   0x20 32
            {0x00,0x00,0x6f,0x00,0x00},   // ! 0x21 33
            {0x00,0x07,0x00,0x07,0x00},   // " 0x22 34
            {0x14,0x7f,0x14,0x7f,0x14},   // # 0x23 35
            {0x00,0x07,0x04,0x1e,0x00},   // $ 0x24 36
            {0x23,0x13,0x08,0x64,0x62},   // % 0x25 37
            {0x36,0x49,0x56,0x20,0x50},   // & 0x26 38
            ...SNIP...
            {0x04,0x02,0x04,0x08,0x04},   // ~ 0x7e 126
      };

The error being thrown is:
Quote
font.h:1: error: 'byte' does not name a type

I've had a look around, and found this thread (arduino (dot) cc/cgi-bin/yabb2/YaBB.pl?num=1232933437), but the solution there doesn't work for me.

Changing the array type to int fixes the area, but I'd rather not have to typecast later on in the code.
Thanks to anyone who can shine some light on this.

(The main file that includes this header file is just a test, and doesn't even access it yet).
« Last Edit: June 22, 2010, 12:23:43 am by rmvvwls » Logged

UK
Offline Offline
Faraday Member
**
Karma: 17
Posts: 2884
Gorm deficient
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

byte is just an 'unsigned char'
Logged

Per Arduino ad Astra

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh. I didn't know that.
Changed the code to unsigned char, and it compiles.

Thankyou Groove.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 17
Posts: 2884
Gorm deficient
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The other fix would be to include "wiring.h" in your header.
(I think strictly speaking, a "byte" is a "uint8_t", but that's just a fancy name for "unsigned char").
« Last Edit: June 22, 2010, 01:58:54 am by GrooveFlotilla » Logged

Per Arduino ad Astra

Pages: [1]   Go Up
Jump to: