Something weird going on with this program:
Code: Select all
void main(void)
{
//TRISIO = 1;
//CMCON = 7;
//ANSEL = 0;
unsigned short a, b;
a = 0;
b = 0;
while (1)
{
a = Button(&GPIO, 0, 1, 5);
if (a == 255 && b < 3)
{
b++;
}
else
{
b=0;
}
switch (b)
{
case 0: poweroff(); break;
case 1: bright(); break;
case 2: powersaving(); break;
case 3: blinking(); break;
}
}
}
mC complains that unsigned short a, b; is invalid expression.
Any ideas how to overcome this problem?