View Single Post
  #1   Spotlight this post!  
Unread 13-02-2006, 11:22
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 747
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Pre-Load Arrays in EasyC, Possible?

Can anyone tell us if it is possible to pre-load your array with constant values in easyC? We want to create a lookup table and just need to create a single dimension array and load it with constants.

We have tried to define the constants as show in the screen shot. Look at "power[3]" It's a 1 x 4 array and when we set the value field to something like 0,0,0,0 we get an Error: 1 when we try and compile this.

If we leave it value field blank, such as the variable "sign[3]" then it will compile just fine.

We have tried formatting the value field:
0,0,0,0
{0,0,0,0}
(0,0,0,0)

The only thing that seems to work is leave it blank, then in code somewhere we have to do this:

power[0] = value0
power[1] = value1
power[2] = value2
power[3] = value3
(or write a loop to load up several constants...)

Is this the only way to pre-load the arrays in EasyC?
Attached Thumbnails
Click image for larger version

Name:	array.jpg
Views:	50
Size:	24.9 KB
ID:	3975  
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369