cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Anonymous
Not applicable

Hi,

How could I convert variable uint8 rampasskey[6] = {1,2,3,4,5,6}; to uint32 rampasskey = 123456; ?

Thank you,

Asier.

0 Likes
Reply
1 Solution
JoMe_264151
Expert II

Something like

int ii;

uint32 rampasskey = 0;

uint8 KeyARRAY[6];

for(ii = 5; ii >= 0:ii--)

{

     rampasskey *= 10;

     rampasskey +=  KeyARRAY[ii];

}

Happy coding

Bob

View solution in original post

1 Reply
JoMe_264151
Expert II

Something like

int ii;

uint32 rampasskey = 0;

uint8 KeyARRAY[6];

for(ii = 5; ii >= 0:ii--)

{

     rampasskey *= 10;

     rampasskey +=  KeyARRAY[ii];

}

Happy coding

Bob

View solution in original post