Defining error

Hi guys, I don’t really understand defining in Arduino. I’m getting an error which says I have an undefined reference to “ui”. Can someone please tell me what I need to define. My code is here:

#include <LCD5110_Graph.h>

LCD5110 lcd(8,9,10,12,11);

int sensorPin = A0;
int sensorValue = 0;
int percent = 0;
String percentString =“0”;
int stringLength = 0;

extern unsigned char BigNumbers;
extern uint8_t ui;

int OtherSensorPin = A1;
int OtherSensorValue = 0;
int OtherPercent = 0;
String OtherPercentString = “0”;
int OtherStringLength = 0;

void setup() {
lcd.InitLCD();
lcd.setFont(BigNumbers);
delay(1000);
}

void loop() {
lcd.clrScr();
lcd.drawBitmap(0, 0, ui, 84, 48);
OtherSensorValue = analogRead(OtherSensorPin);
OtherPercent = OtherSensorValue;
OtherPercentString = String(OtherPercent);
OtherStringLength = OtherPercentString.length();

lcd.update();
delay(1000);
}

int convertToPercent(int value)
{
int OtherPercentValue = 0;
OtherPercentValue = map(OtherSensorValue, 1023, 350, 0, 100);
if(OtherPercentValue>100)
OtherPercentValue = 100;
return OtherPercentValue;

int percentValue = 0;
percentValue = map(sensorValue, 1023, 350, 0, 100);
if(percentValue>100)
percentValue = 100;
return percentValue;
}

void displayPercent(int length)
{
switch(length)
{
case 1: lcd.print(percentString,38,19); break;
case 2: lcd.print(percentString,24,19); break;
case 3: lcd.print(percentString,10,19); break;
default:lcd.print(percentString,0,19); break;
}
}

A statement like this

extern uint8_t ui[];

Means that array ui should be defined somewhere else.

wait but I did state that right here:

extern unsigned char BigNumbers;
extern uint8_t ui;

int OtherSensorPin = A1;
int OtherSensorValue = 0;
int OtherPercent = 0;
String OtherPercentString = “0”;
int OtherStringLength = 0;

[/quote]

Why did you declare them 'extern'?

extern unsigned char BigNumbers;
extern uint8_t ui;

Usually one would put a number in here to tell the code how many elements there;

extern unsigned char BigNumbers[6];
extern uint8_t ui[5];

and if not, one lists the elements:

extern unsigned char BigNumbers = {'0', '1', '2', '3', '4', '5',};
extern uint8_t ui = {1,2,3,4,5,};

Usually one would put a number in here to tell the code how many elements there;

Not when the variable is actually declared in another file.

and if not, one lists the elements:

Not when the variable is actually declared in another file.

THAT is what the extern keyword says.