nagkiller
Full Member level 4
PIC CCS C Compiler Hexadecimal to Binary Conversion : How to
Hello!!!
I need code in CCS Compiler to convert the value hex 4C48F5 into value 24 bit binary ( like this 101011110001001000110010 ).
Thanks for reply.
- - - Updated - - -
Solved!!!
In my case the code is:
Hello!!!
I need code in CCS Compiler to convert the value hex 4C48F5 into value 24 bit binary ( like this 101011110001001000110010 ).
Thanks for reply.
- - - Updated - - -
Solved!!!
In my case the code is:
Code:
void Convert(int Code1, int Code2, int Code3)
{
int aux;
int bit;
for(aux = 0; aux < 8; aux++)
{
bit=(Code3>>aux)& 0x01;
}
for(aux = 0; aux < 8; aux++)
{
bit=(Code2>>aux)& 0x01;
}
for(aux = 0; aux < 8; aux++)
{
bit=(Code1>>aux)& 0x01;
}
}
void main()
{
Convert(0x4C,0x48,0xF5);
}