Mondalot
Junior Member level 3
Hey
I would like to translate this "C" to Proton Compiler is for accelerometre.
There are parts of the program that I understand and some do not.
C Code:
THX.
I would like to translate this "C" to Proton Compiler is for accelerometre.
There are parts of the program that I understand and some do not.
C Code:
Code:
volatile char sval[8]; Array of 8 element
void main()
{
unsigned char i;
unsigned char tmp; "tmp" with String
while(1) Bucle While
{
lcd_cmd(L_L1+1); I understand
lcd_str("x="); I understand
tmp=acc_read(0x6); I understand
if(tmp & 0x80) Returns the logical AND of two values ¿ I believe.... ?
{
tmp=~tmp+1; It makes the complement of the variable "~" tmp +1
sval[0]='-'; out sign - to LCD
}
else
sval[0]='+'; out sign + to LCD
sval[1]=((tmp)/100)+0x30; NO understand
sval[2]=((tmp%100)/10)+0x30; NO understand
sval[3]=(tmp%10)+0x30; NO understand
sval[4]=0; NO understand
lcd_str(sval); Out all to LCD ¿ I believe.... ?
THX.