Sample C Coding files and instructions for Robobuilder 57xx

Korean company maker of Robot kits and servos designed for of articulated robots. Re-incarnation of Megarobotics.
17 postsPage 2 of 21, 2
17 postsPage 2 of 21, 2

Sorry to post again!

Post by ebrand » Tue Mar 16, 2010 6:17 am

Post by ebrand
Tue Mar 16, 2010 6:17 am

Sorry to post again, but after more research I am able to post a more specific question. The C code that is the problem is as follows:


Code: Select all
    if(F_PF == PF1_HUNO){
        switch(BtnCode){
            case BTN_A:
                 SendToSoundIC(7);
                gpT_Table    = HUNOBASIC_GETUPFRONT_Torque;
                ....
                break;


gpT_Table is defined as follows:
Code: Select all
BYTE flash    *gpT_Table;


HUNOBASIC_GETUPFRONT_Torque is defined as follows:
Code: Select all
unsigned char flash HUNOBASIC_GETUPFRONT_Torque[9][16]={
   /* ID
       0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15 */
   {   4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4 },   // Idx:0 - Data_0
   {   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  4,  4,  4,  4,  4,  4 },   // Idx:1 - Data_1
   {   4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4 },   // Idx:2 - Data_2
   {   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1 },   // Idx:3 - Data_3
   {   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1 },   // Idx:4 - Data_4
   {   2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2 },   // Idx:5 - Data_5
   {   2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2 },   // Idx:6 - Data
   {   2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2 },   // Idx:7 - Data_6
   {   4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4 }    // Idx:8 - Data_7
};



I am getting the following error:

Error: C:\Users\emily\Documents\Robotics\C_Tutorial_Source-1\Project\maze\maze.c(2393): a value of type 'flash unsigned char [9][16]' can't be assigned to an entity of type 'flash unsigned char *'

So it seems the code is trying to make a char * = to an array. Is there some way I can make the code actually make sense?

Thanks!
Sorry to post again, but after more research I am able to post a more specific question. The C code that is the problem is as follows:


Code: Select all
    if(F_PF == PF1_HUNO){
        switch(BtnCode){
            case BTN_A:
                 SendToSoundIC(7);
                gpT_Table    = HUNOBASIC_GETUPFRONT_Torque;
                ....
                break;


gpT_Table is defined as follows:
Code: Select all
BYTE flash    *gpT_Table;


HUNOBASIC_GETUPFRONT_Torque is defined as follows:
Code: Select all
unsigned char flash HUNOBASIC_GETUPFRONT_Torque[9][16]={
   /* ID
       0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15 */
   {   4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4 },   // Idx:0 - Data_0
   {   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  4,  4,  4,  4,  4,  4 },   // Idx:1 - Data_1
   {   4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4 },   // Idx:2 - Data_2
   {   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1 },   // Idx:3 - Data_3
   {   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1 },   // Idx:4 - Data_4
   {   2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2 },   // Idx:5 - Data_5
   {   2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2 },   // Idx:6 - Data
   {   2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2 },   // Idx:7 - Data_6
   {   4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4 }    // Idx:8 - Data_7
};



I am getting the following error:

Error: C:\Users\emily\Documents\Robotics\C_Tutorial_Source-1\Project\maze\maze.c(2393): a value of type 'flash unsigned char [9][16]' can't be assigned to an entity of type 'flash unsigned char *'

So it seems the code is trying to make a char * = to an array. Is there some way I can make the code actually make sense?

Thanks!
ebrand offline
Robot Builder
Robot Builder
Posts: 9
Joined: Mon Mar 15, 2010 9:32 pm

Post by l3v3rz » Tue Mar 16, 2010 9:30 pm

Post by l3v3rz
Tue Mar 16, 2010 9:30 pm

I think the compiler is right ! Surely gpT_Table points to an array so you want :

BYTE flash gpTable[][];

or possibly

BYTE flash gpTable[][16];

alternatively try casting it:

gpT_Table = (BYTE flash *)HUNOBASIC_GETUPFRONT_Torque;


Bit disappointing the tutorial doesn't work out of the box .... I've never tried it as I don't want to fork out for full version CV AVR (150 Euros)

Good luck - I see you trying my L# maze prog as well - so much easier to use. (and free)
I think the compiler is right ! Surely gpT_Table points to an array so you want :

BYTE flash gpTable[][];

or possibly

BYTE flash gpTable[][16];

alternatively try casting it:

gpT_Table = (BYTE flash *)HUNOBASIC_GETUPFRONT_Torque;


Bit disappointing the tutorial doesn't work out of the box .... I've never tried it as I don't want to fork out for full version CV AVR (150 Euros)

Good luck - I see you trying my L# maze prog as well - so much easier to use. (and free)
l3v3rz offline
Savvy Roboteer
Savvy Roboteer
Posts: 473
Joined: Fri Jul 18, 2008 2:34 pm

Previous
Previous
17 postsPage 2 of 21, 2
17 postsPage 2 of 21, 2
cron