Log in

View Full Version : Array Syntax Error


Andrew Blair
04-02-2006, 21:15
I'm using a lookup table to take joystick values and return a cubic function of them, basically just a drive ramp, but I cannot seem to get my array to compile properly. I have here a drastically reduced version, but one that still returns the same syntax error.


rom const unsigned char[2] = {0,3};


I've consulted all of the lookup table threads, but I feel that I have a small syntax error that is holding this up.

Alan Anderson
04-02-2006, 21:27
A small syntax error? You left out the name of the array!

rom const unsigned char arrname[2] = {0,3};

Mark McLeod
04-02-2006, 21:29
rom const unsigned char x[2] = {0,3};

Andrew Blair
04-02-2006, 22:09
Please give me a moment while I proceed to beat my head against the wall...


Thanks! I knew I was missing something!!!

Matt Krass
05-02-2006, 02:05
It's ok.

Half an hour...

Over a dozen code downloads...

Two master resets...

Then I remembered to plug the PWM cables in :)

Oh and yeah, this beauty:
if(x > 0)
{x = 0;}

Eldarion
05-02-2006, 02:16
It's ok.

Half an hour...

Over a dozen code downloads...

Two master resets...

Then I remembered to plug the PWM cables in :)

Speaking of which, here's one my mentor did:

He couldn't get a potentiometer value to display with the new 2006 code, so he put the old 2005 code in, only to discover that it still didn't work. A little while later a student walks in and notices that the OI was unplugged the whole time! :D

Then there's always the problem of "why doesn't the camera work!?"...
Oh, wait, the backup battery came loose again!

Maybe a thread should be started with "Top 100 Stupid Programming Mistakes"? ;)

Rick TYler
05-02-2006, 13:37
Maybe a thread should be started with "Top 100 Stupid Programming Mistakes"?

The MPLAB environment is a great example of the finest IDEs of the 1970s. Modern IDEs save you lots of time during code development. If you can write C everything else looks easy by comparison. Code verifiers, real-time syntax checkers, and instant help systems still won't plug in the battery for you.

Eldarion
05-02-2006, 14:11
The MPLAB environment is a great example of the finest IDEs of the 1970s. Modern IDEs save you lots of time during code development. If you can write C everything else looks easy by comparison. Code verifiers, real-time syntax checkers, and instant help systems still won't plug in the battery for you.

I guess what I meant to say was "Top 100 Stupid Mistakes made by the Programmer". :)