Go Down

Topic: [SOLVED]Array error: 'byte' does not name a type (Read 3248 times) previous topic - next topic


Jun 22, 2010, 06:00 am Last Edit: Jun 22, 2010, 07:23 am by rmvvwls Reason: 1
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: [Select]
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
           {0x04,0x02,0x04,0x08,0x04},   // ~ 0x7e 126

The error being thrown is:
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).


Per Arduino ad Astra


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

Thankyou Groove.


Jun 22, 2010, 08:57 am Last Edit: Jun 22, 2010, 08:58 am by GrooveFlotilla Reason: 1
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").
Per Arduino ad Astra

Go Up