nayakajit87
Member level 5
I am using PIC16F886 with hitech compiler 9.60. Here is below code i am trying to compile.
If i am using compiler v9.86 that is free version below code compile properly and do proper working.
If i am using Pro version of compiler v 9.60 i used to get error. Error are attached below. How to get raid of this issue. How variable should be declared.
Error msg
If i am using compiler v9.86 that is free version below code compile properly and do proper working.
If i am using Pro version of compiler v 9.60 i used to get error. Error are attached below. How to get raid of this issue. How variable should be declared.
Code:
#include <pic.h>
#include <htc.h>
#include "delay.h"
__CONFIG(INTIO & WDTEN & PWRTEN & MCLREN & UNPROTECT & BOREN & IESODIS & FCMDIS & LVPDIS & DEBUGDIS);
__CONFIG (BORV40 & WP2);
//__EEPROM_DATA(0,0,0,0,0,0,0,0);
typedef union
{
struct
{
unsigned S0 :1;
unsigned S1 :1;
unsigned S2 :1;
unsigned S3 :1;
unsigned S4 :1;
unsigned S5 :1;
unsigned S6 :1;
unsigned S7 :1;
};
unsigned char S0_7;
}USensor;
USensor sen;
unsigned char a;
void main (void)
{
for(;;)
{
sen.S0 = 1;
sen.S1 = 0;
sen.S2 = 1;
sen.S3 = 0;
sen.S4 = 1;
sen.S5 = 0;
sen.S6 = 1;
sen.S7 = 0;
a = sen.S0_7;
}
}
Error msg
Code:
Error [285] C:\Users\Testing\Test.c; 25.2 no identifier in declaration
Error [255] C:\Users\Testing\Test.c; 36.8 not a member of the struct/union ""
Error [255] C:\Users\Testing\Test.c; 37.8 not a member of the struct/union ""
Error [255] C:\Users\\Testing\Test.c; 38.8 not a member of the struct/union ""