Tymoty
New Member
Hi, I try convert voltage from MMA7260Q and show on lcd but it doesn't work. this is my code
and before this in main.c
and on senzor is voltage about 1,65V(axes x,y) and when i connect mcu voltage is cca 0,2V. i don't know why
g1=0;
g2=0;
ADCON0bits.ADON=1;
_asm NOP _endasm
_asm NOP _endasm
ADCON0bits.GO=1;
ADCON0bits.CHS0=0;
while(ADCON0bits.GO!=0);
osaX=(ADRESH*256) + ADRESL;
ADCON0bits.ADON=1;
_asm NOP _endasm
_asm NOP _endasm
ADCON0bits.GO=1;
ADCON0bits.CHS0=1;
while(ADCON0bits.GO!=0);
osaY=(ADRESH*256) + ADRESL;
PutMessage((rom char*)"\x16\x0\x8 X:");
PutMessage(osaX);
PutMessage((rom char*)"\x16\x0\x24 Y:");
PutMessage(osaY);
}
and before this in main.c
ADCON0=0x00;
ADCON1=0x0D;
ADCON2=0x95;
and on senzor is voltage about 1,65V(axes x,y) and when i connect mcu voltage is cca 0,2V. i don't know why